Skip to content

Commit 65ac2a0

Browse files
committed
Work on getting stuff to build
1 parent 807cbb1 commit 65ac2a0

File tree

8 files changed

+80
-14
lines changed

8 files changed

+80
-14
lines changed

build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ subprojects { p ->
3333
apply plugin: 'java-library'
3434
apply plugin: libs.plugins.registrationutils.get().pluginId
3535

36-
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
37-
java.withSourcesJar()
38-
java.withJavadocJar()
39-
4036
registrationUtils {
4137
group 'org.groovymc.cgl.reg'
4238
}

buildSrc/src/main/groovy/convention.consumer.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ configurations {
1313
}
1414

1515
dependencies {
16-
allCompileOnly project(path: ':common', configuration: 'namedElements')
16+
allCompileOnly project(path: ':common', configuration: 'exportedClasses')
1717
for (def sourceSet in ['main', 'extension', 'transform']) {
1818
for (def type in ['Java', 'Groovy', 'Resources']) {
1919
add("${sourceSet}Common${type}", project(path: ':common', configuration: "${sourceSet}Common${type}"))

buildSrc/src/main/groovy/convention.shared.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ group = rootProject.group
99

1010
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
1111
java.withSourcesJar()
12-
java.withJavadocJar()
1312

1413
sourceSets {
1514
extension {
@@ -102,7 +101,7 @@ processResources {
102101
sourcesJar {
103102
dependsOn(configurations.rootProjectLicense)
104103
from(configurations.rootProjectLicense) {
105-
rename { "${it}_${artifact_id}" }
104+
rename { "${it}_${rootProject.name}" }
106105
}
107106
from sourceSets.extension.allSource
108107
from sourceSets.transform.allSource
@@ -111,7 +110,7 @@ sourcesJar {
111110
jar {
112111
dependsOn(configurations.rootProjectLicense)
113112
from(configurations.rootProjectLicense) {
114-
rename { "${it}_${artifact_id}" }
113+
rename { "${it}_${rootProject.name}" }
115114
}
116115

117116
dependsOn tasks.named(sourceSets.extension.classesTaskName)

common/build.gradle

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ configurations {
1515
}
1616
}
1717
}
18+
exportedClasses {
19+
canBeResolved = false
20+
canBeConsumed = true
21+
}
1822
}
1923

2024
loom {
@@ -61,8 +65,14 @@ afterEvaluate {
6165

6266
artifacts {
6367
for (def sourceSet in ['main', 'extension', 'transform']) {
64-
add("${sourceSet}CommonJava", sourceSets.main.java.sourceDirectories.singleFile)
65-
add("${sourceSet}CommonGroovy", sourceSets.main.groovy.sourceDirectories.singleFile)
66-
add("${sourceSet}CommonResources", sourceSets.main.resources.sourceDirectories.singleFile)
68+
add("${sourceSet}CommonJava", sourceSets.named(sourceSet).get().java.sourceDirectories.singleFile)
69+
add("${sourceSet}CommonGroovy", sourceSets.named(sourceSet).get().groovy.sourceDirectories.singleFile)
70+
add("${sourceSet}CommonResources", sourceSets.named(sourceSet).get().resources.sourceDirectories.singleFile)
71+
def outputClasses = project.objects.directoryProperty()
72+
sourceSets.named(sourceSet).get().output.classesDirs.files.each {
73+
add('exportedClasses', it) {
74+
builtBy tasks.named(sourceSets.named(sourceSet).get().classesTaskName)
75+
}
76+
}
6777
}
6878
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
MultiplatformModsDotGroovy.make {
2+
modLoader = 'gml'
3+
loaderVersion = '[1,)'
4+
5+
license = 'LGPL-3.0-or-later'
6+
issueTrackerUrl = 'https://github.com/GroovyMC/CommonGroovyLibrary/issues'
7+
8+
mod {
9+
modId = buildProperties['mod_id']
10+
displayName = buildProperties['mod_name']
11+
version = buildProperties['version']
12+
displayUrl = 'https://github.com/GroovyMC/CommonGroovyLibrary'
13+
14+
description = "A library for common easy Groovy mod development."
15+
author = buildProperties['mod_author']
16+
17+
dependencies {
18+
minecraft = ">=${buildProperties['minecraftVersion']}"
19+
20+
onForge {
21+
mod('neoforge') {
22+
versionRange = ">=${buildProperties['platformVersion']}"
23+
}
24+
mod('gml') {
25+
versionRange = ">=${buildProperties['gml_version']}"
26+
}
27+
}
28+
29+
onFabric {
30+
mod('groovyduvet_core') {
31+
versionRange = ">=${buildProperties['groovyduvet_core_version']}"
32+
}
33+
mod('fabric_loader') {
34+
versionRange = ">=${buildProperties['platformVersion']}"
35+
}
36+
}
37+
}
38+
39+
entrypoints {
40+
entrypoint('main') {
41+
adapter = 'groovyduvet'
42+
value = 'org.groovymc.cgl.impl.fabric.CGLFabric'
43+
}
44+
}
45+
}
46+
47+
onFabric {
48+
modmenu = [
49+
'badges':['library'],
50+
'parent':[
51+
'id':'groovyduvet',
52+
'name':'GroovyDuvet',
53+
'description':'Language adapter and wrapper libraries for Groovy mods on Quilt',
54+
'icon':'assets/groovyduvet/icon.png',
55+
'badges':['library']
56+
]
57+
]
58+
}
59+
}

fabric/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ afterEvaluate {
5656
configurations.extensionCompileClasspath.extendsFrom configurations.minecraftNamedCompile
5757

5858
dependencies {
59+
compileOnly reg.loaderSpecific()
5960
transformCompileOnly reg.loaderSpecific()
6061
extensionCompileOnly reg.loaderSpecific()
6162
}

neoforge/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ afterEvaluate {
5656
configurations.extensionCompileClasspath.extendsFrom configurations.minecraftNamedCompile
5757

5858
dependencies {
59+
compileOnly reg.loaderSpecific()
5960
transformCompileOnly reg.loaderSpecific()
6061
extensionCompileOnly reg.loaderSpecific()
6162
}

neoforge/src/test/groovy/cgltest/CommandTest.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import net.minecraft.core.registries.Registries
44
import net.minecraft.network.chat.Component
55
import net.minecraft.world.entity.Entity
66
import net.minecraft.world.level.Level
7-
import net.minecraftforge.event.RegisterCommandsEvent
8-
import net.minecraftforge.eventbus.api.SubscribeEvent
9-
import net.minecraftforge.fml.common.Mod
7+
import net.neoforged.bus.api.SubscribeEvent
8+
import net.neoforged.fml.common.Mod
9+
import net.neoforged.neoforge.event.RegisterCommandsEvent
1010

1111
@Mod.EventBusSubscriber
1212
class CommandTest {

0 commit comments

Comments
 (0)