Arclight/arclight-forge-1.16/build.gradle

185 lines
6.4 KiB
Groovy
Raw Normal View History

2020-08-20 08:57:08 +00:00
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
maven { url = 'https://repo.spongepowered.org/maven' }
mavenCentral()
2021-01-21 10:13:12 +00:00
maven { url = 'https://maven.izzel.io/releases' }
2020-08-20 08:57:08 +00:00
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: "${forge_gradle_version}"
2020-08-20 08:57:08 +00:00
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
2021-01-21 10:13:12 +00:00
classpath "io.izzel.arclight:arclight-gradle-plugin:$agpVersion"
2020-08-20 08:57:08 +00:00
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'io.izzel.arclight'
2020-10-21 07:01:09 +00:00
apply plugin: 'maven-publish'
2020-08-20 08:57:08 +00:00
arclight {
mcVersion = minecraftVersion
forgeVersion = project.ext.forgeVersion
2020-11-21 04:17:26 +00:00
bukkitVersion = 'v1_16_R3'
2020-08-20 08:57:08 +00:00
wipeVersion = true
reobfVersion = true
accessTransformer = project(':arclight-common').file('bukkit.at')
}
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
configurations {
embed
implementation.extendsFrom(embed)
2020-08-20 08:57:08 +00:00
}
minecraft {
2021-02-15 17:12:08 +00:00
mappings channel: 'snapshot', version: "20210215-1.16.3"
2020-08-20 08:57:08 +00:00
accessTransformer = project(':arclight-common').file('src/main/resources/META-INF/accesstransformer.cfg')
}
repositories {
maven {
name = 'sponge-repo'
url = 'https://repo.spongepowered.org/maven'
}
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url = 'https://files.minecraftforge.net/maven/' }
2020-08-22 12:26:14 +00:00
maven { url = 'https://jitpack.io/' }
maven { url = 'https://maven.izzel.io/releases' }
2020-08-20 08:57:08 +00:00
}
2021-01-21 14:27:58 +00:00
def embedLibs = [/*'org.spongepowered:mixin:0.8.1',*/ 'org.ow2.asm:asm-util:9.0',
'org.ow2.asm:asm-analysis:9.0', 'org.yaml:snakeyaml:1.27',
'org.xerial:sqlite-jdbc:3.34.0', 'mysql:mysql-connector-java:5.1.49',
2020-08-20 08:57:08 +00:00
'commons-lang:commons-lang:2.6', 'com.googlecode.json-simple:json-simple:1.1.1',
2021-03-13 04:44:58 +00:00
'org.apache.logging.log4j:log4j-jul:2.11.2', 'net.md-5:SpecialSource:1.9.0',
2020-09-22 05:25:09 +00:00
'org.jline:jline-terminal-jansi:3.12.1', 'org.fusesource.jansi:jansi:1.18',
'org.jline:jline-terminal:3.12.1', 'org.jline:jline-reader:3.12.1',
'jline:jline:2.12.1']
2020-08-20 08:57:08 +00:00
dependencies {
minecraft "net.minecraftforge:forge:$minecraftVersion-$forgeVersion"
implementation group: 'org.jetbrains', name: 'annotations', version: '19.0.0'
implementation(project(':arclight-common')) {
2020-08-20 08:57:08 +00:00
exclude module: 'forge'
}
embed project(':i18n-config')
embed project(':forge-installer')
for (def lib : embedLibs) {
arclight lib
}
2021-01-21 14:27:58 +00:00
embed 'net.md-5:bungeecord-chat:1.16-R0.4@jar'
2020-08-20 08:57:08 +00:00
embed "org.spigotmc:spigot-api:$minecraftVersion-R0.1-SNAPSHOT@jar"
2021-02-04 10:52:38 +00:00
embed 'com.github.ArclightTeam:mixin-tools:1.0.0@jar'
embed 'io.izzel:tools:1.0.+'
2021-02-04 10:52:38 +00:00
annotationProcessor 'org.spongepowered:mixin:0.8.2:processor'
annotationProcessor 'com.github.ArclightTeam:mixin-tools:1.0.0'
2020-08-20 08:57:08 +00:00
}
def getGitHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
processResources {
filesMatching("**/mods.toml") {
expand 'version': "$minecraftVersion-${project.version}-${getGitHash()}"
}
}
jar {
manifest.attributes 'MixinConnector': 'io.izzel.arclight.impl.ArclightConnector_1_16'
manifest.attributes 'Main-Class': 'io.izzel.arclight.server.Main_1_16'
manifest.attributes 'Implementation-Title': 'Arclight'
manifest.attributes 'Implementation-Version': "arclight-$minecraftVersion-${project.version}-${getGitHash()}"
manifest.attributes 'Implementation-Vendor': 'Arclight Team'
manifest.attributes 'Implementation-Timestamp': new Date().format("yyyy-MM-dd HH:mm:ss")
from(configurations.embed.collect { it.isDirectory() ? it : zipTree(it) }) {
exclude "META-INF/MANIFEST.MF"
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
exclude "LICENSE.txt"
}
from(project(':arclight-common').tasks.jar.outputs.files.collect { it.isDirectory() ? it : zipTree(it) })
}
remapSpigotJar {
includes.add('net/minecraft/block/ChestBlock$DoubleInventory')
includes.add('net/minecraft/tileentity/LecternTileEntity$LecternInventory')
}
mixin {
2021-02-04 10:52:38 +00:00
add sourceSets.main, 'mixins.arclight.impl.refmap.1_16.json'
2020-08-20 08:57:08 +00:00
}
compileJava {
options.compilerArgs << '-XDignore.symbol.file' << '-XDenableSunApiLintControl'
options.encoding = 'UTF-8'
2020-10-21 07:01:09 +00:00
}
task srgJar(type: Jar) {
from(tasks.jar.outputs.files.collect { it.isDirectory() ? it : zipTree(it) }) {
include 'io/izzel/**'
exclude 'io/izzel/arclight/common/mixin/**'
}
classifier = 'srg'
}
task spigotJar(type: Jar) {
with tasks.srgJar
doLast {
def task = tasks.create('renameSpigotJar', net.minecraftforge.gradle.userdev.tasks.RenameJarInPlace)
task.input = archivePath
task.hasLog = false
task.mappings = project(':arclight-common').file('build/arclight_cache/tmp_srg/bukkit_srg.srg')
def args = task.args.toList()
args.add('--reverse')
task.setArgs(args)
task.apply()
}
classifier = 'spigot'
}
task sourceJar(type: Jar) {
from(sourceSets.main.allSource)
for (def s in [':arclight-api', ':i18n-config', ':arclight-common', ':forge-installer']) {
from(project(s).sourceSets.main.allSource) {
exclude 'io/izzel/arclight/common/mixin/**'
}
}
classifier = 'sources'
}
publishing {
repositories {
maven {
name = "IzzelAliz"
2020-10-21 07:01:09 +00:00
url = uri('https://maven.izzel.io/' + (project.version.toString().endsWith('SNAPSHOT') ? 'snapshots' : 'releases'))
credentials {
username = project.findProperty("mavenUser") ?: System.getenv("ARCLIGHT_USER")
password = project.findProperty("mavenToken") ?: System.getenv("ARCLIGHT_TOKEN")
}
}
}
publications {
mavenJava(MavenPublication) {
artifact srgJar
artifact spigotJar
artifact sourceJar
}
}
}
if ('true'.equalsIgnoreCase(System.getenv('APPVEYOR_REPO_TAG'))) {
tasks.build.dependsOn(tasks.publish)
}