浏览代码

Add jar signing

malte0811 4 年之前
父节点
当前提交
6bd48234c5
共有 2 个文件被更改,包括 24 次插入2 次删除
  1. 5 2
      README.md
  2. 19 0
      build.gradle

+ 5 - 2
README.md

@@ -1,5 +1,8 @@
 A coremod to save a few of these:  
 <img src="https://upload.wikimedia.org/wikipedia/commons/d/da/KL_CoreMemory.jpg" width="400"/>  
-(Konstantin Lanzet, CC BY-SA 3.0 <http://creativecommons.org/licenses/by-sa/3.0/>, via Wikimedia Commons)
 
-I intend to PR these changes to Forge soon. For a description of the improvements implemented by this mod see [here](summary.md).
+or rather their modern equivalent: RAM.
+
+(Image: Konstantin Lanzet, CC BY-SA 3.0 <http://creativecommons.org/licenses/by-sa/3.0/>, via Wikimedia Commons)
+
+I am working on getting at least some of the changes made by this mod into Forge, features will be removed here if and when they are added to Forge. For a description of the improvements implemented by this mod see [here](summary.md).

+ 19 - 0
build.gradle

@@ -1,4 +1,5 @@
 import java.util.stream.Collectors
+import net.minecraftforge.gradle.common.task.SignJar
 
 buildscript {
     repositories {
@@ -130,6 +131,24 @@ jar {
 
 apply plugin: 'org.spongepowered.mixin'
 
+task signJar(type: SignJar, dependsOn: jar) {
+    onlyIf {
+        project.hasProperty('keyStore')
+    }
+    if (project.hasProperty('keyStore')) {
+        keyStore = project.keyStore
+        alias = project.storeAlias
+        storePass = project.storePass
+        keyPass = project.storePass
+        inputFile = jar.archivePath
+        outputFile = jar.archivePath
+    } else {
+        logger.warn("No key store found, not signing the output jar\n")
+    }
+}
+
+build.dependsOn signJar
+
 mixin {
     add sourceSets.main, "${modid}.refmap.json"
 }