Workaround for gradle issue with jar signing.

This commit is contained in:
LexManos 2018-11-13 16:32:55 -08:00
parent 5110796591
commit 506d5b18de
2 changed files with 19 additions and 21 deletions

View File

@ -1,7 +1,7 @@
buildscript { buildscript {
repositories { repositories {
mavenLocal() mavenLocal()
maven { url = 'http://files.minecraftforge.net/maven' } maven { url = 'https://files.minecraftforge.net/maven' }
jcenter() jcenter()
mavenCentral() mavenCentral()
} }
@ -30,6 +30,17 @@ plugins {
} }
apply plugin: 'eclipse' apply plugin: 'eclipse'
ext {
JAR_SIGNER = null
if (project.hasProperty('keystore')) {
JAR_SIGNER = [
storepass: project.properties.keystoreStorePass,
keypass: project.properties.keystoreKeyPass,
keystore: project.properties.keystore
]
}
}
project(':mcp') { project(':mcp') {
apply plugin: 'net.minecraftforge.gradle.forgedev.mcp' apply plugin: 'net.minecraftforge.gradle.forgedev.mcp'
mcp { mcp {
@ -95,14 +106,6 @@ project(':forge') {
// Essentially, the same as the old, except dropping the first number, and the builds are no longer unique. // Essentially, the same as the old, except dropping the first number, and the builds are no longer unique.
MCP_ARTIFACT = project(':mcp').mcp.config MCP_ARTIFACT = project(':mcp').mcp.config
MCP_VERSION = project(':mcp').mcp.config.version.split('-')[1] // The timestamp only. MCP_VERSION = project(':mcp').mcp.config.version.split('-')[1] // The timestamp only.
if (project.hasProperty('keystore')) {
jarsigner = [
storepass: project.properties.keystoreStorePass,
keypass: project.properties.keystoreKeyPass,
keystore: project.properties.keystore
]
}
} }
patcher { patcher {
parent = project(':clean') parent = project(':clean')
@ -613,13 +616,10 @@ project(':forge') {
task signUniversal(type: SignJar, dependsOn: universalJar) { task signUniversal(type: SignJar, dependsOn: universalJar) {
onlyIf { onlyIf {
project.hasProperty('jarsigner') && universalJar.state.failure == null JAR_SIGNER != null && universalJar.state.failure == null
} }
def jarsigner = [:]; def jarsigner = JAR_SIGNER == null ? [:] : JAR_SIGNER
if (project.hasProperty('jarsigner'))
jarsigner = project.jarsigner;
alias = 'forge' alias = 'forge'
storePass = jarsigner.storepass storePass = jarsigner.storepass
keyPass = jarsigner.keypass keyPass = jarsigner.keypass
@ -663,13 +663,10 @@ project(':forge') {
} }
task signInstaller(type: SignJar, dependsOn: installerJar) { task signInstaller(type: SignJar, dependsOn: installerJar) {
onlyIf { onlyIf {
project.hasProperty('jarsigner') && installerJar.state.failure == null JAR_SIGNER != null && installerJar.state.failure == null
} }
def jarsigner = [:]; def jarsigner = JAR_SIGNER == null ? [:] : JAR_SIGNER
if (project.hasProperty('jarsigner'))
jarsigner = project.jarsigner;
alias = 'forge' alias = 'forge'
storePass = jarsigner.storepass storePass = jarsigner.storepass
keyPass = jarsigner.keypass keyPass = jarsigner.keypass
@ -775,7 +772,7 @@ project(':forge') {
username project.properties.forgeMavenUser username project.properties.forgeMavenUser
password project.properties.forgeMavenPassword password project.properties.forgeMavenPassword
} }
url 'http://files.minecraftforge.net/maven/manage/upload' url 'https://files.minecraftforge.net/maven/manage/upload'
} else { } else {
url 'file://' + rootProject.file('repo').getAbsolutePath() url 'file://' + rootProject.file('repo').getAbsolutePath()
} }

View File

@ -1,7 +1,7 @@
buildscript { buildscript {
repositories { repositories {
mavenLocal() mavenLocal()
maven { url = 'http://files.minecraftforge.net/maven' } maven { url = 'https://files.minecraftforge.net/maven' }
jcenter() jcenter()
mavenCentral() mavenCentral()
} }
@ -18,6 +18,7 @@ buildscript {
} }
apply plugin: 'net.minecraftforge.gradle' apply plugin: 'net.minecraftforge.gradle'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
repositories { repositories {
maven { url ='file://' + file('../repo').absolutePath } //Used by Forge development testing only, you can delete this. maven { url ='file://' + file('../repo').absolutePath } //Used by Forge development testing only, you can delete this.