Skip to content

Commit

Permalink
(fix): use gradle 4.10.3, try fix 1.7.10 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
LoboMetalurgico committed Feb 7, 2022
1 parent 904c6d0 commit bdbe539
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 65 deletions.
15 changes: 8 additions & 7 deletions Forge/1.10.2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ buildscript {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
}
}

apply plugin: 'net.minecraftforge.gradle.forge'

/*
Expand All @@ -32,8 +33,8 @@ plugins {
project(':Forge:1.10.2') {
archivesBaseName = "MineCity-Forge-MC1.10.2"

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

minecraft {
Expand Down Expand Up @@ -65,11 +66,11 @@ repositories {
dependencies {
shade project(':Core')
shade project(':Forge:Base')
compile "mysql:mysql-connector-java:6.0.3"
compile "li.cil.oc:OpenComputers:MC1.10.2-1.7.+:api"
compile "net.industrial-craft:industrialcraft-2:2.6.+:dev"
testCompile fileTree(dir: "run/mods", include: ["*.jar"], exclude:["*Assets*"])
testCompile fileTree(dir: "run/mods/1.7.10", include: ["*.jar"])
implementation "mysql:mysql-connector-java:6.0.3"
implementation "li.cil.oc:OpenComputers:MC1.10.2-1.7.+:api"
implementation "net.industrial-craft:industrialcraft-2:2.6.+:dev"
testImplementation fileTree(dir: "run/mods", include: ["*.jar"], exclude:["*Assets*"])
testImplementation fileTree(dir: "run/mods/1.7.10", include: ["*.jar"])
}

jar {
Expand Down
57 changes: 44 additions & 13 deletions Forge/1.12.2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,29 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:3.+'
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3+', changing: true
}
}
apply plugin: 'net.minecraftforge.gradle'

sourceCompatibility = targetCompatibility = '1.8'
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
}
project(':Forge:1.12.2') {
archivesBaseName = "MineCity-Forge-MC1.12.2"

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

minecraft {
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not allways work.
// 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 channel: 'snapshot', version: '20171003-1.12'
mappings channel: 'snapshot', version: '20171003-1.12'
mappings channel: 'stable', version: '39-1.12'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.

runs {
Expand Down Expand Up @@ -71,6 +70,8 @@ configurations {
compile.extendsFrom shade
}

sourceSets.main.resources { srcDir 'src/generated/resources' }

repositories {
maven { url = "http://maven.cil.li/" }
maven { url = "http://maven.ic2.player.to/" }
Expand All @@ -80,11 +81,11 @@ dependencies {
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2859'
shade project(':Core')
shade project(':Forge:Base')
compile "mysql:mysql-connector-java:6.0.3"
compile "li.cil.oc:OpenComputers:MC1.12.2-1.7.+:api"
compile "net.industrial-craft:industrialcraft-2:2.8.+:dev"
testCompile fileTree(dir: "run/mods", include: ["*.jar"], exclude:["*Assets*"])
testCompile fileTree(dir: "run/mods/1.7.10", include: ["*.jar"])
implementation "mysql:mysql-connector-java:6.0.3"
implementation "li.cil.oc:OpenComputers:MC1.12.2-1.7.+:api"
implementation "net.industrial-craft:industrialcraft-2:2.8.+:dev"
testImplementation fileTree(dir: "run/mods", include: ["*.jar"], exclude:["*Assets*"])
testImplementation fileTree(dir: "run/mods/1.7.10", include: ["*.jar"])
}

jar {
Expand All @@ -106,3 +107,33 @@ jar {
// Example configuration to allow publishing using the maven-publish task
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')

processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version

// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'

// replace version and mcversion
expand 'version':project.version, 'mcversion': "1.12.2"
}

// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}

// workaround for userdev bug
tasks.create("copyResourceToClasses", Copy.class) {
tasks.classes.dependsOn(it)
dependsOn(tasks.processResources)
onlyIf { gradle.taskGraph.hasTask(tasks.prepareRuns) }

into("$buildDir/classes/java/main")
// if you write @Mod class in kotlin, please use code below
// into("$buildDir/classes/kotlin/main")
from(tasks.processResources.destinationDir)
}
25 changes: 17 additions & 8 deletions Forge/1.7.10/UCS/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
url = "https://maven.minecraftforge.net/"
}
maven {
name = "forge2"
url = "https://files.minecraftforge.net/maven"
}
maven {
name = "covertdragon"
url = "https://maven.covertdragon.team/repository/internal/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath ('com.anatawa12.forge:ForgeGradle:1.2-1.0.+') {
classpath ('com.anatawa12.forge:ForgeGradle:1.2-1.0.2') {
changing = true
}
}
Expand All @@ -22,8 +31,8 @@ apply plugin: 'forge'
project(':Forge:1.7.10:UCS') {
archivesBaseName = "MineCity-Forge-MC1.7.10-UCS"

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

minecraft {
Expand All @@ -42,10 +51,10 @@ repositories {
}

dependencies {
compile project(':Forge:1.7.10')
compile "com.github.GameModsBR:UniversalCoinsServer:e0aab5dbb6111b524a00933f5dfa2faddc4ef2e5"
testCompile fileTree(dir: "run/mods", include: ["*.jar"], exclude:["*Assets*"])
testCompile fileTree(dir: "run/mods/1.7.10", include: ["*.jar"])
implementation(project(':Forge:1.7.10'))
implementation "com.github.GameModsBR:UniversalCoinsServer:e0aab5dbb6111b524a00933f5dfa2faddc4ef2e5"
testImplementation fileTree(dir: "run/mods", include: ["*.jar"], exclude:["*Assets*"])
testImplementation fileTree(dir: "run/mods/1.7.10", include: ["*.jar"])
}

jar {
Expand Down
20 changes: 12 additions & 8 deletions Forge/1.7.10/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ buildscript {
name = "forge2"
url = "https://files.minecraftforge.net/maven"
}
maven {
name = "covertdragon"
url = "https://maven.covertdragon.team/repository/internal/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath ('com.anatawa12.forge:ForgeGradle:1.2-1.0.+') {
classpath ('com.anatawa12.forge:ForgeGradle:1.2-1.0.2') {
changing = true
}
}
Expand All @@ -27,8 +31,8 @@ apply plugin: 'forge'
project(':Forge:1.7.10') {
archivesBaseName = "MineCity-Forge-MC1.7.10"

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

minecraft {
Expand All @@ -51,11 +55,11 @@ dependencies {
shade project(':Core')
shade project(':Forge:Base')
// shade "org.mcstats.forge:metrics:R8-SNAPSHOT" TODO: Get another nexus for this dependence
compile "mysql:mysql-connector-java:5.1.32"
compile "li.cil.oc:OpenComputers:MC1.7.10-1.7.+:api"
compile "net.industrial-craft:industrialcraft-2:2.2.825-experimental:dev"
testCompile fileTree(dir: "run/mods", include: ["*.jar"], exclude:["*Assets*"])
testCompile fileTree(dir: "run/mods/1.7.10", include: ["*.jar"])
implementation "mysql:mysql-connector-java:5.1.32"
implementation "li.cil.oc:OpenComputers:MC1.7.10-1.7.+:api"
implementation "net.industrial-craft:industrialcraft-2:2.2.825-experimental:dev"
testImplementation fileTree(dir: "run/mods", include: ["*.jar"], exclude:["*Assets*"])
testImplementation fileTree(dir: "run/mods/1.7.10", include: ["*.jar"])
}

jar {
Expand Down
11 changes: 6 additions & 5 deletions Forge/Base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ buildscript {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
}
}

apply plugin: 'net.minecraftforge.gradle.forge'

/*
Expand All @@ -32,8 +33,8 @@ plugins {
project(':Forge:Base') {
archivesBaseName = "MineCity-Forge-Base"

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

minecraft {
Expand All @@ -50,11 +51,11 @@ minecraft {
}

dependencies {
compile project(':Core')
compile(project(':VaultEco')) {
implementation(project(':Core'))
implementation(project(':VaultEco')) {
transitive = false
}
compile(project(':SpongeEco')) {
implementation(project(':SpongeEco')) {
transitive = false
}
}
59 changes: 36 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
}
}

plugins {
id("com.github.johnrengelman.shadow") version "4.0.4"
}

apply plugin: 'java'

allprojects {
apply plugin: "java"
apply plugin: 'java'

group= "br.com.gamemods.minecity"
version = "1.0.A.3-SNAPSHOT"

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
}

subprojects {
subprojects {
apply plugin: 'java'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

repositories {
mavenCentral()
maven {
Expand All @@ -40,37 +50,40 @@ subprojects {
}
maven {
name = 'vault-repo'
url = 'http://nexus.hc.to/content/repositories/pub_releases'
url = 'https://nexus.hc.to/content/repositories/pub_releases'
}
maven {
url = 'https://jitpack.io'
}
}

dependencies {
compile "org.jetbrains:annotations:13.0"
testCompile "org.luaj:luaj-jse:3.0.1"

testCompile "junit:junit:4.12"
testCompile "org.powermock:powermock-module-junit4:1.6.5"
testCompile "org.powermock:powermock-api-mockito:1.6.5"
testCompile project(":UnitTest")
testCompile "mysql:mysql-connector-java:5.1.32"
implementation "org.jetbrains:annotations:13.0"

testImplementation "org.luaj:luaj-jse:3.0.1"

testImplementation "junit:junit:4.12"
testImplementation "org.powermock:powermock-module-junit4:1.6.5"
testImplementation "org.powermock:powermock-api-mockito:1.6.5"
testImplementation project(":UnitTest")
testImplementation "mysql:mysql-connector-java:5.1.32"
}
}



project(':VaultEco') {
dependencies {
compile project(':Core')
compile "net.milkbowl.vault:VaultAPI:1.6"
compile "org.bukkit:bukkit:1.8-R0.1-SNAPSHOT"
implementation(project(':Core'))
implementation "net.milkbowl.vault:VaultAPI:1.6"
implementation "org.bukkit:bukkit:1.8-R0.1-SNAPSHOT"
}
}

project(':SpongeEco') {
dependencies {
compile project(':Core')
compile 'org.spongepowered:spongeapi:5.0.0'
implementation(project(':Core'))
implementation 'org.spongepowered:spongeapi:5.0.0'
}
}

Expand Down Expand Up @@ -121,6 +134,6 @@ project(':Bukkit') {

project(':UnitTest') {
dependencies {
compile "org.assertj:assertj-core:3.1.0"
implementation "org.assertj:assertj-core:3.1.0"
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip

0 comments on commit bdbe539

Please sign in to comment.