Files
architectury-plugin/build.gradle
2021-03-10 01:56:05 +08:00

110 lines
2.9 KiB
Groovy

plugins {
id "org.jetbrains.kotlin.jvm" version "1.3.72"
id "java"
id "idea"
id "eclipse"
id "maven-publish"
}
group "me.shedaniel"
def isSnapshot = System.getenv("PR_NUM") != null
def runNumber = (System.getenv("GITHUB_RUN_NUMBER") == null ? "9999" : 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 {
maven { url "https://maven.fabricmc.net/" }
maven { url "https://files.minecraftforge.net/maven/" }
maven { url "https://maven.shedaniel.me/" }
gradlePluginPortal()
}
apply plugin: 'java-gradle-plugin'
dependencies {
implementation gradleApi()
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72"
implementation "org.jetbrains.kotlin:kotlin-reflect:1.3.72"
implementation "gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.10"
implementation "me.shedaniel:architectury-transformer:$transformer_version"
compileOnly "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"
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = ['-Xjvm-default=compatibility']
}
}
jar {
manifest {
attributes 'Implementation-Version': project.version
}
}
gradlePlugin {
plugins {
architect {
id = pluginId
implementationClass = 'me.shedaniel.architect.plugin.ArchitectPlugin'
}
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier("sources")
from sourceSets.main.allSource
}
publishing {
publications {
plugin(MavenPublication) {
groupId pluginId
artifactId pluginId + '.gradle.plugin'
from components.java
artifact(sourcesJar)
}
pluginSnapshot(MavenPublication) {
groupId pluginId
artifactId pluginId + '.gradle.plugin'
version base_version + '-SNAPSHOT'
from components.java
artifact(sourcesJar)
}
}
repositories {
if (System.getenv("MAVEN_PASS") != null) {
maven {
url = "https://deploy.shedaniel.me/"
credentials {
username = "shedaniel"
password = System.getenv("MAVEN_PASS")
}
}
}
}
}