Files
architectury-plugin/build.gradle
shedaniel 7f725c16f9 Snapshot Build (#5)
* Test snapshot

* Invert snapshot flag

* Change version format

* Detect if file is properly closed.

* Use ATOMIC_MOVE

* Try using renameTo

* Check if can access before remap

* Check if can access before remap

* Please, delete it

* Can you please work

* Maybe just maybe

* Test

* So it works?
2021-01-23 20:50:52 +08:00

123 lines
3.2 KiB
Groovy

plugins {
id "org.jetbrains.kotlin.jvm" version "1.3.72"
id "com.jfrog.bintray" version "1.8.5"
id "java"
id "idea"
id "eclipse"
id "maven"
id "maven-publish"
}
group "me.shedaniel"
def isSnapshot = System.getenv("PR_NUM") != null
def runNumber = (System.getenv("GITHUB_RUN_NUMBER") == null ? (((short) new Random().nextInt()).abs() + 1000).toString() : System.getenv("GITHUB_RUN_NUMBER"))
if (!isSnapshot) {
version = base_version + "." + runNumber
} else {
version = base_version + "-PR." + System.getenv("PR_NUM") + "." + runNumber
}
def pluginId = "architectury-plugin"
logger.lifecycle(":building architectury plugin v${version}")
sourceCompatibility = targetCompatibility = 1.8
repositories {
jcenter()
maven { url "https://maven.fabricmc.net/" }
maven { url "https://files.minecraftforge.net/maven/" }
maven { url "https://dl.bintray.com/shedaniel/cloth/" }
}
apply plugin: 'java-gradle-plugin'
sourceSets {
annotationsInject
}
dependencies {
implementation gradleApi()
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72"
implementation "org.jetbrains.kotlin:kotlin-reflect:1.3.72"
implementation "me.shedaniel:forgified-fabric-loom:$loom_version"
runtime "me.shedaniel:forgified-fabric-loom:$loom_version"
implementation "net.fabricmc:tiny-remapper:0.3.0.70"
implementation "net.fabricmc:tiny-mappings-parser:0.2.2.14"
implementation "org.ow2.asm:asm:8.0"
implementation "org.ow2.asm:asm-commons:8.0"
implementation "org.ow2.asm:asm-tree:8.0"
implementation "org.ow2.asm:asm-util:8.0"
implementation "org.zeroturnaround:zt-zip:1.13"
implementation "com.google.code.gson:gson:2.8.5"
}
task annotationsInjectJar(type: Jar) {
classifier = 'annotations-inject'
from sourceSets.annotationsInject.output
}
jar {
dependsOn annotationsInjectJar
from(annotationsInjectJar.outputs) {
into "annotations-inject"
rename { "injection.jar" }
}
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
gradlePlugin {
plugins {
architect {
id = pluginId
implementationClass = 'me.shedaniel.architect.plugin.ArchitectPlugin'
}
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier("sources")
from sourceSets.main.allSource
}
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_KEY')
publications = ["MyPublication"]
publish = true
pkg {
repo = "cloth"
name = "architect-plugin"
userOrg = "shedaniel"
licenses = ["MIT"]
version {
name = project.version
vcsTag = project.version
released = new Date()
vcsUrl = 'https://github.com/shedaniel/architect-plugin.git'
}
}
}
publishing {
publications {
MyPublication(MavenPublication) {
groupId pluginId
artifactId pluginId + '.gradle.plugin'
from components.java
artifact(sourcesJar)
}
}
repositories {
}
}