Skip to content

Commit 309acfa

Browse files
authored
Use GTCEu maven (#66)
1 parent 464618e commit 309acfa

File tree

5 files changed

+86
-45
lines changed

5 files changed

+86
-45
lines changed

.github/workflows/publish.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ jobs:
5454
generate_release_notes: true
5555
fail_on_unmatched_files: true
5656

57+
- name: Publish to Maven
58+
env:
59+
MAVEN_USER: "${{ secrets.MAVEN_USER }}"
60+
MAVEN_PASSWORD: "${{ secrets.MAVEN_PASSWORD }}"
61+
run: ./gradlew publish
62+
5763
- name: Publish to Curseforge
5864
uses: gradle/gradle-build-action@v2
5965
env:

CODEOWNERS

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# All other changes require the primary team
22
* @GregTechCEu/gregtech-1-12-devs
33

4-
# GitHub Actions changes require admin approval
5-
/.github/** @GregTechCEu/admin
6-
74
# Specific files requiring admin approval
85
CHANGELOG.md @GregTechCEu/admin
96
CHANGELOG-GTCEU.md @GregTechCEu/admin
@@ -14,4 +11,10 @@ README.md @GregTechCEu/admin
1411
permission*.png @GregTechCEu/admin
1512

1613
# Gradle changes require specific reviewers
17-
**gradle** @TechLord22 @ALongStringOfNumbers
14+
**gradle** @GregTechCEu/gregtech-build-team
15+
/.github/** @GregTechCEu/gregtech-build-team
16+
.editorconfig @GregTechCEu/gregtech-build-team
17+
spotless.eclipseformat.xml @GregTechCEu/gregtech-build-team
18+
spotless.importorder @GregTechCEu/gregtech-build-team
19+
.gitignore @GregTechCEu/gregtech-build-team
20+
/libs/** @GregTechCEu/gregtech-build-team

build.gradle

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//version: 1704659416
1+
//version: 1707682661
22
/*
33
* DO NOT CHANGE THIS FILE!
44
* Also, you may replace this file at any time if there is an update available.
@@ -24,9 +24,9 @@ plugins {
2424
id 'eclipse'
2525
id 'maven-publish'
2626
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7'
27-
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.25'
28-
id 'net.darkhax.curseforgegradle' version '1.1.17' apply false
29-
id 'com.modrinth.minotaur' version '2.8.6' apply false
27+
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.33'
28+
id 'net.darkhax.curseforgegradle' version '1.1.18' apply false
29+
id 'com.modrinth.minotaur' version '2.8.7' apply false
3030
id 'com.diffplug.spotless' version '6.13.0' apply false
3131
id 'com.palantir.git-version' version '3.0.0' apply false
3232
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
@@ -446,6 +446,10 @@ repositories {
446446
name 'GTNH Maven'
447447
url 'https://nexus.gtnewhorizons.com/repository/public/'
448448
}
449+
maven {
450+
name 'GTCEu Maven'
451+
url 'https://maven.gtceu.com'
452+
}
449453
}
450454
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
451455
// need to add this here even if we did not above
@@ -473,9 +477,25 @@ configurations {
473477
config.extendsFrom(shadowCompile)
474478
}
475479
}
480+
481+
create("runtimeOnlyNonPublishable") {
482+
description = "Runtime only dependencies that are not published alongside the jar"
483+
canBeConsumed = false
484+
canBeResolved = false
485+
}
486+
create("devOnlyNonPublishable") {
487+
description = "Runtime and compiletime dependencies that are not published alongside the jar (compileOnly + runtimeOnlyNonPublishable)"
488+
canBeConsumed = false
489+
canBeResolved = false
490+
}
491+
492+
compileOnly.extendsFrom(devOnlyNonPublishable)
493+
runtimeOnlyNonPublishable.extendsFrom(devOnlyNonPublishable)
494+
runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
495+
testRuntimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
476496
}
477497

478-
String mixinProviderSpec = 'zone.rong:mixinbooter:8.9'
498+
String mixinProviderSpec = 'zone.rong:mixinbooter:9.1'
479499
dependencies {
480500
if (usesMixins.toBoolean()) {
481501
annotationProcessor 'org.ow2.asm:asm-debug-all:5.2'
@@ -493,7 +513,7 @@ dependencies {
493513
transitive = false
494514
}
495515
} else if (forceEnableMixins.toBoolean()) {
496-
runtimeOnly(mixinProviderSpec)
516+
runtimeOnlyNonPublishable(mixinProviderSpec)
497517
}
498518

499519
if (enableJUnit.toBoolean()) {
@@ -503,8 +523,8 @@ dependencies {
503523
}
504524

505525
if (enableModernJavaSyntax.toBoolean()) {
506-
annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:1.0.0'
507-
compileOnly('com.github.bsideup.jabel:jabel-javac-plugin:1.0.0') {
526+
annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:1.0.1'
527+
compileOnly('com.github.bsideup.jabel:jabel-javac-plugin:1.0.1') {
508528
transitive = false
509529
}
510530
// workaround for https://github.com/bsideup/jabel/issues/174
@@ -513,8 +533,8 @@ dependencies {
513533
patchedMinecraft 'me.eigenraven.java8unsupported:java-8-unsupported-shim:1.0.0'
514534

515535
// allow Jabel to work in tests
516-
testAnnotationProcessor "com.github.bsideup.jabel:jabel-javac-plugin:1.0.0"
517-
testCompileOnly("com.github.bsideup.jabel:jabel-javac-plugin:1.0.0") {
536+
testAnnotationProcessor "com.github.bsideup.jabel:jabel-javac-plugin:1.0.1"
537+
testCompileOnly("com.github.bsideup.jabel:jabel-javac-plugin:1.0.1") {
518538
transitive = false // We only care about the 1 annotation class
519539
}
520540
testCompileOnly "me.eigenraven.java8unsupported:java-8-unsupported-shim:1.0.0"
@@ -527,9 +547,13 @@ dependencies {
527547
}
528548

529549
if (includeCommonDevEnvMods.toBoolean()) {
530-
implementation 'mezz.jei:jei_1.12.2:4.16.1.302'
531-
//noinspection DependencyNotationArgument
532-
implementation rfg.deobf('curse.maven:top-245211:2667280') // TOP 1.4.28
550+
if (!(modId.equals('jei'))) {
551+
implementation 'mezz.jei:jei_1.12.2:4.16.1.302'
552+
}
553+
if (!(modId.equals('theoneprobe'))) {
554+
//noinspection DependencyNotationArgument
555+
implementation rfg.deobf('curse.maven:top-245211:2667280') // TOP 1.4.28
556+
}
533557
}
534558
}
535559

@@ -541,6 +565,12 @@ pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
541565
}
542566
}
543567

568+
configurations.configureEach {
569+
resolutionStrategy.dependencySubstitution {
570+
substitute module('org.scala-lang:scala-library:2.11.1') using module('org.scala-lang:scala-library:2.11.5') because('To allow mixing with Java 8 targets')
571+
}
572+
}
573+
544574
if (getFile('dependencies.gradle').exists()) {
545575
apply from: 'dependencies.gradle'
546576
} else if (getFile('dependencies.gradle.kts').exists()) {

dependencies.gradle

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,42 @@
11
//file:noinspection DependencyNotationArgument
22
// TODO remove when fixed in RFG ^
33
/*
4-
* Add your dependencies here. Common configurations:
5-
* - implementation("group:name:version:classifier"): if you need this for internal implementation details of the mod.
6-
* Available at compiletime and runtime for your environment.
7-
*
8-
* - compileOnlyApi("g:n:v:c"): if you need this for internal implementation details of the mod.
9-
* Available at compiletime but not runtime for your environment.
10-
*
4+
* Add your dependencies here. Supported configurations:
5+
* - api("group:name:version:classifier"): if you use the types from this dependency in the public API of this mod
6+
* Available at runtime and compiletime for mods depending on this mod
7+
* - implementation("g:n:v:c"): if you need this for internal implementation details of the mod, but none of it is visible via the public API
8+
* Available at runtime but not compiletime for mods depending on this mod
9+
* - compileOnly("g:n:v:c"): if the mod you're building doesn't need this dependency during runtime at all, e.g. for optional mods
10+
* Not available at all for mods depending on this mod, only visible at compiletime for this mod
11+
* - compileOnlyApi("g:n:v:c"): like compileOnly, but also visible at compiletime for mods depending on this mod
12+
* Available at compiletime but not runtime for mods depending on this mod
13+
* - runtimeOnlyNonPublishable("g:n:v:c"): if you want to include a mod in this mod's runClient/runServer runs, but not publish it as a dependency
14+
* Not available at all for mods depending on this mod, only visible at runtime for this mod
15+
* - devOnlyNonPublishable("g:n:v:c"): a combination of runtimeOnlyNonPublishable and compileOnly for dependencies present at both compiletime and runtime,
16+
* but not published as Maven dependencies - useful for RFG-deobfuscated dependencies or local testing
17+
* - runtimeOnly("g:n:v:c"): if you don't need this at compile time, but want it to be present at runtime
18+
* Available at runtime for mods depending on this mod
1119
* - annotationProcessor("g:n:v:c"): mostly for java compiler plugins, if you know you need this, use it, otherwise don't worry
20+
* - testCONFIG("g:n:v:c") - replace CONFIG by one of the above (except api), same as above but for the test sources instead of main
21+
*
22+
* - shadowImplementation("g:n:v:c"): effectively the same as API, but the dependency is included in your jar under a renamed package name
23+
* Requires you to enable usesShadowedDependencies in gradle.properties
24+
* For more info, see https://github.com/GregTechCEu/Buildscripts/blob/master/docs/shadow.md
1225
*
13-
* - testCONFIG("g:n:v:c"): replace CONFIG by one of the above, same as above but for the test sources instead of main
26+
* You can exclude transitive dependencies (dependencies of the chosen dependency) by appending { transitive = false } if needed,
27+
* but use this sparingly as it can break using your mod as another mod's dependency if you're not careful.
1428
*
15-
* You can exclude transitive dependencies (dependencies of the chosen dependency) by appending { transitive = false } if needed.
29+
* To depend on obfuscated jars you can use `devOnlyNonPublishable(rfg.deobf("dep:spec:1.2.3"))` to fetch an obfuscated jar from maven,
30+
* or `devOnlyNonPublishable(rfg.deobf(project.files("libs/my-mod-jar.jar")))` to use a file.
1631
*
1732
* To add a mod with CurseMaven, replace '("g:n:v:c")' in the above with 'rfg.deobf("curse.maven:project_slug-project_id:file_id")'
18-
* Example: implementation rfg.deobf("curse.maven:gregtech-ce-unofficial-557242:4527757")
33+
* Example: devOnlyNonPublishable(rfg.deobf("curse.maven:top-245211:2667280"))
1934
*
20-
* To shadow a dependency, use 'shadowImplementation'. For more info, see https://github.com/GregTechCEu/Buildscripts/blob/master/docs/shadow.md
35+
* Gradle names for some of the configuration can be misleading, compileOnlyApi and runtimeOnly both get published as dependencies in Maven, but compileOnly does not.
36+
* The buildscript adds runtimeOnlyNonPublishable to also have a runtime dependency that's not published.
2137
*
22-
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
38+
* For more details, see https://docs.gradle.org/8.4/userguide/java_library_plugin.html#sec:java_library_configurations_graph
2339
*/
2440
dependencies {
25-
26-
27-
// Hard Dependencies
28-
// the CCL deobf jar uses very old MCP mappings, making it error at runtime in runClient/runServer
29-
// therefore we manually deobf the regular jar
30-
implementation rfg.deobf("curse.maven:codechicken-lib-1-8-242818:2779848") // CCL 3.2.3.358
31-
// manually deobf the jar to prevent extra configuration for handling obf/deobf separation
32-
implementation rfg.deobf("curse.maven:gregtech-ce-unofficial-557242:4965457-deobf-4965458-sources-4965459")
33-
34-
// Soft Dependencies
35-
implementation "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.20.684"
36-
implementation rfg.deobf("curse.maven:ctm-267602:2915363") // CTM 1.0.2.31
37-
implementation ("com.cleanroommc:groovyscript:0.7.1") {
38-
transitive = false
39-
}
41+
api("gregtech:gregtech:2.8.7-beta")
4042
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ noPublishedSources = false
148148
# For maven credentials:
149149
# Username is set with the 'MAVEN_USER' environment variable, default to "NONE"
150150
# Password is set with the 'MAVEN_PASSWORD' environment variable, default to "NONE"
151-
customMavenPublishUrl =
151+
customMavenPublishUrl = https://maven.gtceu.com
152152

153153
# The group for maven artifacts. Defaults to the 'project.modGroup' until the last '.' (if any).
154154
# So 'mymod' becomes 'mymod' and 'com.myname.mymodid' 'becomes com.myname'

0 commit comments

Comments
 (0)