Skip to content

Commit

Permalink
build script updates
Browse files Browse the repository at this point in the history
- use ssl to interact with the Forge maven
- update Forge and mappings versions
- fix Forge version string for newer versions of ForgeGradle
- add maven artifact attributes to jar manifest
- add BoP soft dependency
- update token replacement
- update LonelyBiome.java as per token replacement changes
- clean up project properties and processResources
- update mcmod.info due to properties changes
- add reckon for versioning

Signed-off-by: srs-bsns <[email protected]>
  • Loading branch information
srs-bsns committed Mar 5, 2019
1 parent a187f44 commit 8e13914
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 46 deletions.
53 changes: 33 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,42 +1,55 @@
buildscript {
repositories {
jcenter()
maven { url = "http://files.minecraftforge.net/maven" }
maven { url = "https://files.minecraftforge.net/maven" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
plugins {
id "org.ajoberstar.reckon" version "0.9.0"
}
apply plugin: "net.minecraftforge.gradle.forge"

sourceCompatibility = targetCompatibility = 1.8

group = project.package_base
archivesBaseName = project.name + "-" + (project.mc_version as String)
version = project.mod_version
group = "org.teamrtg"
archivesBaseName = "${project.name}-${project.mc_version}"

reckon {
scopeFromProp()
stageFromProp("alpha", "beta", "final")
}

repositories {
maven {
name = "BoP"
url = "https://files.minecraftforge.net/maven"
}
}

dependencies {
provided "com.github.glitchfiend.biomesoplenty:BiomesOPlenty:${project.mc_version}-${project.bop_version}:deobf"
}

minecraft {
version = project.mcf_version
version = "${project.mc_version}-${project.mcf_version}"
mappings = project.mcp_mappings
makeObfSourceJar = false
setRunDir "run"
replace '@MOD_VERSION@', project.version
replace '0.0-MCF+MINVER', project.mcf_minver
replace '9001.0-MCF+MAXVER', project.mcf_maxver
replace ';after:MODDEPS', (!project.hasProperty("mod_depstring")) ? "" : project.mod_depstring
replaceIn 'LonelyBiome.java'
replace "@MOD_VERSION@", project.version as String
replace "@MCF_MINVER@", project.mcf_minver
replace "@BOP_VERSION@", project.bop_version
replaceIn "LonelyBiome.java"
}

processResources {
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand ([
'modid':project.mod_id,
'name':project.mod_name,
'version':project.mod_version,
'mcversion':project.mc_version,
])
include "mcmod.info"
expand (["version":project.version as String, "mcversion":project.mc_version])
}
from(sourceSets.main.resources.srcDirs) {exclude 'mcmod.info'}
from(sourceSets.main.resources.srcDirs) {exclude "mcmod.info"}
}

jar.manifest.attributes "Maven-Artifact": "${project.group}:${archivesBaseName}:${project.version}"
15 changes: 4 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
mod_id=lonelybiome
mod_name=LonelyBiome
mod_version=2.0.0
mod_depstring=

mc_version=1.12.2
mcf_version=14.23.0.2494
mcf_minver=14.23.0.2491
mcf_maxver=
mcp_mappings=snapshot_20170930
mcf_version=14.23.5.2815
mcf_minver=14.23.5.2779
mcp_mappings=stable_39

run_dir=run
package_base=org.teamrtg
bop_version=7.0.1.2399
20 changes: 7 additions & 13 deletions src/main/java/teamrtg/lonelybiome/LonelyBiome.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,18 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

@SuppressWarnings("unused")

@Mod(
modid = LonelyBiome.MOD_ID,
name = LonelyBiome.MOD_NAME,
version = LonelyBiome.MOD_VERSION,
guiFactory = "teamrtg.lonelybiome.LonelyBiome$LBGuiConfigFactory",
dependencies = "required-after:forge@[" + LonelyBiome.MCF_MINVER + "," + LonelyBiome.MCF_MAXVER + ")" + LonelyBiome.MOD_DEPS,
modid = LonelyBiome.MOD_ID,
name = "Lonely Biome",
version = "@MOD_VERSION@",
dependencies = "required-after:forge@[@MCF_MINVER@,);after:biomesoplenty@[@BOP_VERSION@,);",
guiFactory = "teamrtg.lonelybiome.LBConfig$LBGuiConfigFactory",
acceptableRemoteVersions = "*"
)
public final class LonelyBiome
{
static final String MOD_ID = "lonelybiome";
static final String MOD_NAME = "Lonely Biome";
static final String MOD_VERSION = "@MOD_VERSION@";
static final String MCF_MINVER = "0.0-MCF+MINVER";
static final String MCF_MAXVER = "9001.0-MCF+MAXVER";
static final String MOD_DEPS = ";after:MODDEPS";
private static final Logger LOGGER = LogManager.getLogger(MOD_ID);
static final String MOD_ID = "lonelybiome";

@Mod.Instance(MOD_ID) private static LonelyBiome instance;
@Mod.EventHandler void initPre (FMLPreInitializationEvent event) { proxy.preInit (event); }
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[{
"modid": "${modid}",
"name": "${name}",
"modid": "lonelybiome",
"name": "Lonely Biome",
"description": "A Minecraft mod that allows you generate single-biome worlds.",
"version": "${version}",
"mcversion": "${mcversion}",
Expand Down

0 comments on commit 8e13914

Please sign in to comment.