Skip to content

Commit

Permalink
Initial 1.14 port
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Sep 26, 2019
1 parent 2913225 commit 5eb2a0f
Show file tree
Hide file tree
Showing 32 changed files with 557 additions and 577 deletions.
272 changes: 260 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// For those who want the bleeding edge
buildscript {
repositories {
mavenCentral()
Expand All @@ -8,18 +9,21 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
}
}

plugins {
// For people who want stable
//id "net.minecraftforge.gradle.forge" version "2.0.2"
id 'com.matthewprenger.cursegradle' version '1.1.0'
id 'com.matthewprenger.cursegradle' version '1.4.0'
}

// For those who want the bleeding edge
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'idea'
apply plugin: 'maven'

import net.minecraftforge.gradle.common.task.SignJar

loadProperties()

Expand All @@ -44,21 +48,265 @@ def loadProperties() {
project.buildnumber = System.getenv().BUILD_NUMBER
if (System.getenv().TRAVIS_BUILD_NUMBER)
project.buildnumber = System.getenv().TRAVIS_BUILD_NUMBER
if (System.getenv().CI) {
//project.buildnumber += "-DEV"
}

if (System.getenv().RELEASE || System.getenv().TRAVIS_TAG)
project.buildnumber = "RELEASE"
logger.lifecycle "BUILDING VERSION: " + project.buildnumber
}

apply from: 'gradle/forge.gradle'
apply from: 'gradle/dev.gradle'
apply from: 'gradle/deploy.gradle'
sourceSets {
api
main {
compileClasspath += sourceSets.api.output
runtimeClasspath += sourceSets.api.output
}
test {
compileClasspath += sourceSets.api.output
runtimeClasspath += sourceSets.api.output
}
}

configurations {
apiCompile.extendsFrom(compile)
javadoc.classpath += sourceSets.api.output
}

repositories {
mavenCentral()
mavenLocal()
maven {
name "Cyclops Repo"
url "https://oss.jfrog.org/artifactory/simple/libs-release/"
}
}

dependencies {
minecraft "net.minecraftforge:forge:${config.minecraft_version}-${config.forge_version}"

// Add something like 'cyclopscore_version_local=0.1.0-DEV' to your gradle.properties if you want to use a custom local CyclopsCore version.
if(project.hasProperty("cyclopscore_version_local")) {
compile "org.cyclops.cyclopscore:CyclopsCore:${config.minecraft_version}-${project.cyclopscore_version_local}:deobf"
} else {
compile "org.cyclops.cyclopscore:CyclopsCore:${config.minecraft_version}-${config.cyclopscore_version}:deobf"
}

// Project lombok
compileOnly "org.projectlombok:lombok:1.16.4"
}

minecraft {
mappings channel: "${config.mcp_mappings_channel}", version: "${config.mcp_mappings_version}"

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

runs {
client {
workingDirectory project.file('run')
//property 'forge.logging.markers', 'REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
mods {
structuredcrafting {
source sourceSets.main
source sourceSets.api
}
}
}

server {
workingDirectory project.file('run')
property 'forge.logging.console.level', 'debug'
mods {
structuredcrafting {
source sourceSets.main
source sourceSets.api
}
}
}

data {
workingDirectory project.file('run')
property 'forge.logging.console.level', 'debug'
args '--mod', 'structuredcrafting', '--all', '--output', file('src/generated/resources/')
mods {
structuredcrafting {
source sourceSets.main
source sourceSets.api
}
}
}
}
}

if (project.buildnumber.equals("RELEASE"))
version = "${config.minecraft_version}-${config.mod_version}"
else
version = "${config.minecraft_version}-${config.mod_version}-${buildnumber}"

jar {
manifest {
attributes([
"FMLAT": "accesstransformer.cfg",
"Specification-Title": "${project.name}",
"Specification-Vendor": "rubensworks",
"Specification-Version": "${config.mod_version}",
"Implementation-Title": "${project.name}",
"Implementation-Version": "${config.mod_version}",
"Implementation-Vendor" :"rubensworks",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}

task signJar(type: SignJar, dependsOn: jar) {
onlyIf {
System.getenv().SIGN_KEYSTORE
}

keyStore = System.getenv().SIGN_KEYSTORE
alias = System.getenv().SIGN_ALIAS
storePass = System.getenv().SIGN_STOREPASS
keyPass = System.getenv().SIGN_KEYPASS
inputFile = jar.archivePath
outputFile = jar.archivePath
}
build.dependsOn signJar

task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
manifest {
attributes([
"FMLAT": "accesstransformer.cfg",
"Specification-Title": "${project.name}",
"Specification-Vendor": "rubensworks",
"Specification-Version": "${config.mod_version}",
"Implementation-Title": "${project.name}",
"Implementation-Version": "${config.mod_version}",
"Implementation-Vendor" :"rubensworks",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}

task apiJar(type: Jar) {
from sourceSets.main.output
from sourceSets.main.java
classifier = 'api'
include 'structuredcrafting/api/**'
}

task sourceJar(type: Jar) {
classifier = "sources"
from sourceSets.main.allJava
}

task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
classifier 'javadoc'
}

artifacts {
archives deobfJar
archives apiJar
archives sourceJar
archives javadocJar
}

curseforge {
if(project.hasProperty("curseforge_key")) {
apiKey = project.curseforge_key
} else if(System.getenv().TRAVIS && System.getenv().CURSEFORGE_KEY_SECRET) {
apiKey = System.getenv().CURSEFORGE_KEY_SECRET
}

project {
id = "233151" // my project url is http://minecraft.curseforge.com/mc-mods/233151/
releaseType = project.config.release_type
mainArtifact(jar) {
relations {
requiredDependency 'cyclops-core'
}
}

changelog = ""
if (new File("resources/changelog/${project.version}.txt").exists()) {
changelog = new File("resources/changelog/${project.version}.txt").text
}

addArtifact deobfJar
addArtifact sourceJar
addArtifact javadocJar
}
}

configurations {
deployerJars
}

dependencies {
deployerJars "org.apache.maven.wagon:wagon-ftp:2.2"
}

uploadArchives {
repositories {
add getProject().repositories.mavenLocal()
}
repositories.mavenDeployer {
configuration = configurations.deployerJars

if (project.hasProperty("filesmaven_url")) {
logger.info('Publishing to files server')
repository(url: project.filesmaven_url) {
authentication(userName: project.filesmaven_username, password: project.filesmaven_key)
}
} else if (System.getenv().MAVEN_URL) {
logger.info('Publishing to files server')
repository(url: System.getenv().MAVEN_URL) {
authentication(userName: System.getenv().MAVEN_USERNAME, password: System.getenv().MAVEN_KEY)
}
} else {
logger.info('Publishing to repo folder')
repository(url: 'file://localhost/' + project.file('~/.m2/repository').getAbsolutePath())
}

pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
}
pom.project {
name project.archivesBaseName
packaging 'jar'
description 'todo'
url 'https://github.com/CyclopsMC/StructuredCrafting'

scm {
url 'https://github.com/CyclopsMC/StructuredCrafting'
connection 'scm:git:git://github.com/CyclopsMC/StructuredCrafting.git'
developerConnection 'scm:git:[email protected]:CyclopsMC/StructuredCrafting.git'
}

issueManagement {
system 'github'
url 'https://github.com/CyclopsMC/StructuredCrafting/issues'
}

developers {
developer {
id 'rubensworks'
name 'rubensworks'
roles { role 'developer' }
}
}
}
}
}

// Mark API directory as source directory in IDEA.
idea {
module {
sourceDirs += file('src/api/java')
for (String excludeDirName in ["run", "out", "logs", "gradle"]) {
File excludeDir = new File(projectDir, excludeDirName)
excludeDirs.add(excludeDir)
}
}
}
9 changes: 5 additions & 4 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
mod_version=0.2.1
minecraft_version=1.12.2
forge_version=14.23.5.2768
mcp_mappings_version=snapshot_20180814
cyclopscore_version=1.1.0-928
minecraft_version=1.14.4
forge_version=28.1.1
mcp_mappings_channel=snapshot
mcp_mappings_version=20190719-1.14.3
cyclopscore_version=1.5.3-999
release_type=release
fingerprint=bd0353b3e8a2810d60dd584e256e364bc3bedd44

Loading

0 comments on commit 5eb2a0f

Please sign in to comment.