Skip to content

Commit

Permalink
fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Vliro committed Aug 30, 2020
1 parent a744dea commit 8d7b47d
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 178 deletions.
174 changes: 89 additions & 85 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,146 +1,150 @@
plugins {
id 'com.github.johnrengelman.shadow' version '5.2.0'
id 'net.minecraftforge.gradle.userdev' version '3.1.1'
id 'maven-publish'
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
maven { url 'http://dvs1.progwml6.com/files/maven' }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
}
}

evaluationDependsOn(':version')

//if (!System.env.USE_SUBMODULES) {
// afterEvaluate {
// def tesseract = tasks.create('buildTesseractDependency')
// tesseract.dependsOn(gradle.includedBuild('tesseract').task(':forge:publishToMavenLocal'))
// tasks.findByPath(':compileJava').dependsOn(tesseract)
// }
//}

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
task deobfJar(type: ShadowJar) {
from sourceSets.main.output
configurations = [project.configurations.deobf]
classifier "dev"
repositories {
maven { url 'http://dvs1.progwml6.com/files/maven' }
}

group = 'com.github.gregtech-intergalactical'
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = '1.0'
group = 'com.github.gregtech-intergalactical' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'antimatter'

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.

sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
include '**/**'
srcDirs += 'src/generated/resources'
exclude '.cache'
}
}
}
//Print out JVM information so that we know what version is running. Extreamly useful for people to know when helping you.
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))

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 always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'snapshot', version: "${mappings_version}"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.

// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
workingDirectory project.file('run')

// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'

mods {
antimatter {
gti {
source sourceSets.main
}
}
}

server {
workingDirectory project.file('run')

// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'

mods {
antimatter {
gti {
source sourceSets.main
}
}
}

data {
workingDirectory project.file('run')

// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
args '--mod', 'antimatter', '--all', '--output', project.file('src/generated/resources/'), '--existing', sourceSets.main.resources.srcDirs[0]

args '--mod', 'antimatter', '--all', '--output', file('src/generated/resources/')

mods {
antimatter {
gti {
source sourceSets.main
}
}
}
}
}

repositories {
if (!System.env.RELEASE) {
mavenLocal()
} else {
maven { url 'https://files.axelandre42.ovh/maven' }
dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"

// You may put jars on which you depend on in ./libs or you may define them like so..
// compile "some.group:artifact:version:classifier"
// compile "some.group:artifact:version"
implementation project(path: ':forge', configuration: 'deobf')


if (local_dev_dependancies.toBoolean()) {
compileOnly fg.deobf("mezz.jei:jei-${jei_version}:api")
runtimeOnly fg.deobf("mezz.jei:jei-${jei_version}")
}
else {
compileOnly fg.deobf("mezz.jei:jei-${jei_version}:api")
runtimeOnly fg.deobf("mezz.jei:jei-${jei_version}")
}
// Real examples
// compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
// compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env

maven { url 'http://dvs1.progwml6.com/files/maven' }
maven { url 'https://modmaven.k-4u.nl' }
maven {url = 'https://files.minecraftforge.net/maven'}
}
// The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
// provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
// These dependencies get remapped to your current MCP mappings
// deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'

implementation 'com.github.gregtech-intergalactical:tesseract-forge:0.0.+:dev' changing true
// For more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html

compileOnly fg.deobf("mezz.jei:jei-${jei_version}:api")
runtimeOnly fg.deobf("mezz.jei:jei-${jei_version}")
}

task sourcesJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allSource
}

if (!System.env.RELEASE) {
build.dependsOn 'publishToMavenLocal'
}
// Example configuration to allow publishing using the maven-publish task
// This is the preferred method to reobfuscate your jar file
//jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
publish.dependsOn('reobfJar')

project.afterEvaluate {
publishing {
publications {
fat(MavenPublication) {
artifact jar
artifact deobfJar
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}

repositories {
if (System.env.MAVEN_URL) {
maven {
url = System.env.MAVEN_URL

if (System.env.MAVEN_USERNAME && System.env.MAVEN_PASSWORD) {
authentication {
basic(BasicAuthentication)
}

credentials {
username = System.env.USERNAME
password = System.env.PASSWORD
}
}
}
}
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
}
}

}
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ loader_version=31
forge_version=31.2.27

jei_version=1.15.2:6.0.0.2

local_dev_dependencies=true
17 changes: 6 additions & 11 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
pluginManagement {
repositories {
gradlePluginPortal()

maven { url = 'https://files.axelandre42.ovh/maven/' }
maven { url = 'https://files.minecraftforge.net/maven/' }
jcenter()
}
}

rootProject.name = 'antimatter'

include 'version'
includeBuild 'tesseract'

include ":tesseract"
project(":tesseract").projectDir = file("tesseract")

//include ":tesseract:forge"
//project(":tesseract:forge").projectDir = file("tesseract/forge")

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion version/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def getVersion() {
def minor = versionProperties.getProperty('version.minor', '0')
def revision = versionProperties.getProperty('version.revision', '0')

return major + '.' + minor + '.' + revision + getVersionAppendage()
return major + '.' + minor + '.' + revision// + getVersionAppendage()
}

def printVersion() {
Expand Down

0 comments on commit 8d7b47d

Please sign in to comment.