Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
151 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,5 @@ mappings_version=1.18.2 | |
|
||
mixin_version=0.8.5 | ||
|
||
github_repo=auioc/arnicalib-mcmod | ||
arnicalib_version=5.3.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
def jarManifest = [ | ||
"Specification-Title": 'arnicalib', | ||
"Specification-Vendor": 'AUIOC', | ||
"Specification-Version": '1', | ||
"Implementation-Title": project.name, | ||
"Implementation-Version": "${arnicalib_version}", | ||
"Implementation-Vendor" :'AUIOC', | ||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), | ||
"TweakClass": 'org.spongepowered.asm.launch.MixinTweaker', | ||
"TweakOrder": 0, | ||
"MixinConfigs": 'arnicalib.mixin.json', | ||
"ArnicaLib-Version": "${project.archivesBaseName}-${project.fullVersion}" | ||
] | ||
|
||
jar { | ||
manifest {attributes(jarManifest)} | ||
} | ||
jar.finalizedBy('reobfJar') | ||
|
||
task deobfJar(type: Jar) { | ||
from sourceSets.main.output | ||
classifier = 'deobf' | ||
manifest {attributes(jarManifest)} | ||
} | ||
task sourcesJar(type: Jar, dependsOn: classes) { | ||
from sourceSets.main.allSource | ||
classifier = 'sources' | ||
manifest {attributes(jarManifest)} | ||
} | ||
task forgelibJar(type: Jar) { | ||
from sourceSets.main.output | ||
from sourceSets.main.allJava | ||
classifier = 'forgelib' | ||
manifest {attributes(jarManifest)} | ||
} | ||
|
||
artifacts { | ||
archives sourcesJar | ||
archives deobfJar | ||
archives forgelibJar | ||
} | ||
|
||
tasks.build.dependsOn('sourcesJar', 'deobfJar', 'forgelibJar') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
groupId project.group | ||
artifactId project.archivesBaseName | ||
version project.version | ||
artifact jar | ||
artifact deobfJar { | ||
classifier 'deobf' | ||
} | ||
artifact sourcesJar { | ||
classifier 'sources' | ||
} | ||
artifact forgelibJar { | ||
classifier 'forgelib' | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
name = 'GitHubPackages' | ||
url = uri("https://maven.pkg.github.com/${github_repo}") | ||
credentials { | ||
username = System.getenv('GITHUB_ACTOR') | ||
password = System.getenv('GITHUB_TOKEN') | ||
} | ||
} | ||
maven { | ||
name = 'McmodsRepo' | ||
url "file://${project.projectDir}/mcmodsrepo" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apply plugin: 'signing' | ||
|
||
signing { | ||
useInMemoryPgpKeys(findProperty('signingKey'), findProperty('signingPassword')) | ||
sign publishing.publications | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
task genUpdateJson() { | ||
doFirst { | ||
def j = [ | ||
'homepage': "https://github.com/${github_repo}/releases", | ||
'promos': [ | ||
"${minecraft_version}-latest": "${project.modVersion}", | ||
"${minecraft_version}-recommended": "${project.modVersion}", | ||
] | ||
] | ||
File file = file("tmp/${minecraft_version}.json") | ||
file.write(groovy.json.JsonOutput.toJson(j)) | ||
} | ||
} | ||
|
||
task outputProjectFullName() { | ||
file("tmp/fullname.txt").write("${project.archivesBaseName}-${project.fullVersion}") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
def getExecOutput(commands) { | ||
def out = new ByteArrayOutputStream() | ||
exec { | ||
commandLine commands | ||
standardOutput out | ||
} | ||
return out.toString().trim(); | ||
} | ||
|
||
def getEnvAsBoolean(name) { | ||
return System.getenv(name) && System.getenv(name).toBoolean() | ||
} | ||
|
||
ext { | ||
getExecOutput = this.&getExecOutput | ||
getEnvAsBoolean = this.&getEnvAsBoolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apply from: "$rootDir/gradle/utils.gradle" | ||
|
||
def getBuildVersion() { | ||
if (getEnvAsBoolean('CI')) { | ||
if (getEnvAsBoolean('GITHUB_ACTIONS')) { | ||
def dev = getEnvAsBoolean('IS_RELEASE') ? '' : 'dev-' | ||
def sha = System.getenv('GITHUB_SHA').substring(0, 7) | ||
def buildNumber = System.getenv('GITHUB_RUN_NUMBER') | ||
|
||
return "${dev}rev.${sha}-build.${buildNumber}" | ||
} else { | ||
return System.getenv('CI_VERSION') | ||
} | ||
} else { | ||
def sha = getExecOutput(['git', 'rev-parse', '--verify', '--short', 'HEAD']) | ||
def dirty = getExecOutput(['git', 'status', '--short']).isEmpty() ? '' : '-dirty' | ||
return "dev-rev.${sha}-build.0${dirty}" | ||
} | ||
} | ||
|
||
|
||
project.ext.baseVersion = "${minecraft_version}-${project.modVersion}" | ||
project.ext.fullVersion = "${baseVersion}-${getBuildVersion()}" | ||
project.version = getEnvAsBoolean('IS_RELEASE') ? baseVersion : fullVersion | ||
|
||
logger.lifecycle("Project version: ${project.version}") | ||
logger.lifecycle("Full version: ${fullVersion}") |