Skip to content

Commit

Permalink
Cleanup gradle/maven stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnuecke committed Aug 22, 2021
1 parent 50d5fa3 commit 5506f91
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 58 deletions.
66 changes: 32 additions & 34 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
}
}

Expand Down Expand Up @@ -38,8 +38,7 @@ if (build_number == null)
build_number = getGitRef()

version = "${semver}+${build_number}"
group = mod_group
archivesBaseName = "${mod_name.replace(' ', '-')}-MC${minecraft_version}-Forge"
group = 'li.cil.oc2'

java.toolchain.languageVersion = JavaLanguageVersion.of(8)

Expand All @@ -52,27 +51,27 @@ repositories {
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"

compileOnly "org.jetbrains:annotations:16.0.2"
compileOnly 'org.jetbrains:annotations:21.0.1'

implementation "li.cil.sedna:sedna-mc:MC${minecraft_version}-Forge-1.0.1+271"
implementation "li.cil.sedna:sedna-${minecraft_version}-forge:1.0.0+"

// These three will be provided by sedna-mc in standalone.
implementation "li.cil.ceres:ceres:0.0.2+20"
implementation "li.cil.sedna:sedna:1.0.1+101"
implementation "li.cil.sedna:sedna-buildroot:0.0.1+15"
implementation 'li.cil.ceres:ceres:0.0.3+'
implementation 'li.cil.sedna:sedna:1.0.1+'
implementation 'li.cil.sedna:sedna-buildroot:0.0.1+15'

compileOnly fg.deobf("li.cil.markdown_manual:MarkdownManual:MC${minecraft_version}-Forge-${manual_version}:api")
runtimeOnly fg.deobf("li.cil.markdown_manual:MarkdownManual:MC${minecraft_version}-Forge-${manual_version}")
compileOnly fg.deobf("li.cil.markdown_manual:markdown_manual-${minecraft_version}-forge:${manual_version}:api")
runtimeOnly fg.deobf("li.cil.markdown_manual:markdown_manual-${minecraft_version}-forge:${manual_version}")

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

testImplementation "li.cil.ceres:ceres:0.0.2+20"
testImplementation "li.cil.sedna:sedna:1.0.0+100"
testImplementation 'li.cil.ceres:ceres:0.0.3+'
testImplementation 'li.cil.sedna:sedna:1.0.1+'

testImplementation "org.mockito:mockito-core:2.+"
testImplementation "org.junit.jupiter:junit-jupiter-api:5.3.1"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.3.1"
testImplementation 'org.mockito:mockito-core:2.+'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
}

task packageScripts(type: Zip) {
Expand All @@ -81,23 +80,7 @@ task packageScripts(type: Zip) {
from 'src/main/scripts'
}

processResources {
dependsOn { packageScripts }
from(sourceSets.main.resources.srcDirs) {
include 'META-INF/mods.toml'

expand([
'mod_version' : version,
'mod_name' : mod_name,
'mod_url' : mod_url,
'mod_issues_url' : mod_issues_url,
'forge_version_min' : forge_version_min,
'minecraft_version_min': minecraft_version_min,
'oc2_sedna_version_min': oc2_sedna_version_min,
'manual_version_min' : manual_version,
])
}
}
processResources.dependsOn(packageScripts)

minecraft {
mappings channel: mappings_channel, version: mappings_version
Expand Down Expand Up @@ -182,7 +165,6 @@ artifacts {
publishing {
publications {
mavenJava(MavenPublication) {
version "MC${minecraft_version}-Forge-${version}"
artifact jar
artifact apiJar
}
Expand All @@ -194,6 +176,22 @@ publishing {
}
}

curseforge {
apiKey = project.hasProperty('curseForgeApiKey') ? project.curseForgeApiKey : ''
project {
id = curse_project_id
releaseType = curse_project_releaseType
changelogType = 'markdown'
changelog = file('changelog.md')
addGameVersion 'Forge'
addGameVersion minecraft_version
addGameVersion 'Java 8'
relations {
requiredDependency 'markdownmanual'
}
}
}

idea {
module {
for (final String exclude in ['assets', 'run', 'out', 'logs', 'src/generated']) {
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Initial release.
12 changes: 2 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,18 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

minecraft_version=1.16.5
minecraft_version_min=1.16.5
mappings_channel=official
mappings_version=1.16.5
forge_version=36.1.32
forge_version_min=36.1.0

mod_group=li.cil.oc2
mod_id=oc2
mod_name=OpenComputers II
mod_url=https://github.com/fnuecke/oc2
mod_issues_url=https://github.com/fnuecke/oc2/issues
version_major=0
version_minor=0
version_patch=1

oc2_sedna_version_min=0.0.1
manual_version=1.1.0+

jei_minecraft_version=1.16.4
jei_version=7.6.1.71

curse.project.id=0
curse.project.releaseType=release
curse_project_id=0
curse_project_releaseType=release
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-6.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
3 changes: 1 addition & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
rootProject.name = 'oc2'

rootProject.name = 'oc2-1.16.5-forge'
20 changes: 9 additions & 11 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
modLoader = "javafml"
loaderVersion = "[31,)"
issueTrackerURL = "${mod_issues_url}"
loaderVersion = "[36,)"
issueTrackerURL = "https://github.com/fnuecke/oc2/issues"
license = "MIT"

[[mods]]
modId = "oc2"
version = "${mod_version}"
displayName = "${mod_name}"
displayURL = "${mod_url}"
#logoFile = "logo.png"
version = "${file.jarVersion}"
displayName = "OpenComputers II"
authors = "Sangar"
description = '''
Modern computers for the modern player.
Expand All @@ -19,23 +17,23 @@ This mod uses the Terminus Font under the Open Font License.
[[dependencies.oc2]]
modId = "forge"
mandatory = true
versionRange = "[${forge_version_min},)"
versionRange = "[36.1.0,)"
ordering = "NONE"
side = "BOTH"
[[dependencies.oc2]]
modId = "minecraft"
mandatory = true
versionRange = "[${minecraft_version_min}]"
versionRange = "[1.16.5,1.17)"
ordering = "NONE"
side = "BOTH"
[[dependencies.oc2]]
modId = "oc2-sedna"
modId = "sedna"
mandatory = true
versionRange = "[${oc2_sedna_version_min},)"
versionRange = "[0.0.1,)"
ordering = "NONE"
side = "BOTH"
[[dependencies.oc2]]
modId = "markdown_manual"
mandatory = true
versionRange = "[${manual_version_min},)"
versionRange = "[1.1.0,)"
side = "CLIENT"

0 comments on commit 5506f91

Please sign in to comment.