Automatic versioning

This commit is contained in:
Timo Ley 2019-05-28 19:50:30 +02:00
parent cb6c59d0c7
commit 253245a202
2 changed files with 17 additions and 4 deletions

View File

@ -1,3 +1,5 @@
import org.apache.tools.ant.filters.ReplaceTokens
buildscript {
repositories {
jcenter()
@ -5,6 +7,7 @@ buildscript {
name = "forge"
url = "https://files.minecraftforge.net/maven"
}
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
@ -42,6 +45,9 @@ minecraft {
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = project.mcpVersion
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
replace '${version}', project.version
}
repositories {
@ -58,6 +64,10 @@ repositories {
name = "CoFH Maven"
url = "http://maven.covers1624.net"
}
maven {
name = "CurseForge"
url = "https://minecraft.curseforge.com/api/maven/"
}
maven { url "https://jitpack.io" }
maven { url "https://maven.latmod.com/" }
@ -66,18 +76,21 @@ repositories {
}
dependencies {
deobfCompile ("com.gitlab.lcoremodders:LucraftCore:${core_version}")
deobfCompile ("com.gitlab.lcoremodders:LucraftCore:2.4.2")
deobfCompile 'com.gitlab.lcoremodders:HeroesExpansion:1.3.3'
deobfCompile 'com.gitlab.lcoremodders:SpeedsterHeroes:1e4b1fb951'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
manifest {
attributes 'FMLCorePlugin': 'lucraft.mods.lucraftcore.core.LucraftCoreCoreMod', 'FMLCorePluginContainsFMLMod': 'true'
}
}
artifacts {
@ -87,7 +100,7 @@ artifacts {
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "version", getVersionName
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
@ -95,7 +108,7 @@ processResources {
include "mcmod.info"
// replace version and mcversion
expand "version": project.version, "mcversion": project.minecraft.version
expand "version": getVersionName, "mcversion": project.minecraft.version
}
// copy everything else, thats not the mcmod.info

View File

@ -31,7 +31,7 @@ public class Infinity {
public static final String MOD_ID = "infinity";
public static final String MOD_NAME = "Infinityraft";
public static final String VERSION = "1.5";
public static final String VERSION = "${version}";
public static final String DEPENDENCIES = "required-after:lucraftcore@[1.12.2-2.4.0,)";
public static final SimpleNetworkWrapper NETWORK_WRAPPER = NetworkRegistry.INSTANCE.newSimpleChannel(MOD_ID);