Selaa lähdekoodia

update build.gradle to use properties

TheIllusiveC4 6 vuotta sitten
vanhempi
sitoutus
c5f022da5d
3 muutettua tiedostoa jossa 18 lisäystä ja 8 poistoa
  1. 8 5
      build.gradle
  2. 8 0
      gradle.properties
  3. 2 3
      src/main/java/c4/customfov/CustomFoV.java

+ 8 - 5
build.gradle

@@ -11,9 +11,9 @@ apply plugin: 'net.minecraftforge.gradle.forge'
 //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
 
 
-version = "1.12.2-0.2"
-group = "c4.customfov" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
-archivesBaseName = "customfov"
+version = "${version_minecraft}-${version_mod}"
+group = "${mod_group}.${mod_id}" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
+archivesBaseName = "${mod_id}"
 
 sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
 compileJava {
@@ -21,7 +21,7 @@ compileJava {
 }
 
 minecraft {
-    version = "1.12.2-14.23.4.2705"
+    version = "${version_minecraft}-${version_forge}"
     runDir = "run"
     
     // the mappings can be changed at any time, and must be in the following format.
@@ -29,8 +29,11 @@ minecraft {
     // stable_#            stables are built at the discretion of the MCP team.
     // Use non-default mappings at your own risk. they may not always work.
     // simply re-run your setup task after changing the mappings to update your workspace.
-    mappings = "stable_39"
+    mappings = "${version_mcp}"
     // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
+    replace '@VERSION@', project.version
+    replace '@FINGERPRINT@', project.findProperty('signSHA1')
+    replaceIn "${mod_class}.java"
 }
 
 dependencies {

+ 8 - 0
gradle.properties

@@ -0,0 +1,8 @@
+mod_group=c4
+mod_id=customfov
+mod_class=CustomFoV
+
+version_mod=0.2
+version_minecraft=1.12.2
+version_forge=14.23.4.2705
+version_mcp=stable_39

+ 2 - 3
src/main/java/c4/customfov/CustomFoV.java

@@ -11,16 +11,15 @@ import org.apache.logging.log4j.Level;
 
 @Mod(   modid = CustomFoV.MODID,
         name = CustomFoV.NAME,
-        version = CustomFoV.VERSION,
+        version = "@VERSION@",
         dependencies = "required-after:forge@[14.23.4.2705,)",
         acceptedMinecraftVersions = "[1.12, 1.13)",
-        certificateFingerprint = "5d5b8aee896a4f5ea3f3114784742662a67ad32f",
+        certificateFingerprint = "@FINGERPRINT@",
         clientSideOnly = true)
 public class CustomFoV {
 
     public static final String MODID = "customfov";
     public static final String NAME = "Custom FoV";
-    public static final String VERSION = "0.2";
 
     @EventHandler
     public void init(FMLInitializationEvent evt) {