Skip to content

Commit

Permalink
Make tests build too
Browse files Browse the repository at this point in the history
  • Loading branch information
Technici4n committed Jan 26, 2025
1 parent 9c4e70e commit 4733b01
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
23 changes: 19 additions & 4 deletions projects/neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ sourceSets {
java {
srcDirs rootProject.file('src/client/java')
}
compileClasspath += main.compileClasspath
compileClasspath += main.output
runtimeClasspath += main.runtimeClasspath
runtimeClasspath += main.output
}
}

java {
registerFeature('client') {
usingSourceSet(sourceSets.client)
disablePublication()
}
}

Expand Down Expand Up @@ -151,6 +154,8 @@ dependencies {
// Must be implementation instead of compileOnly so that running dependent projects such as tests will trigger (re)compilation of coremods.
// (Only needed when compiling through IntelliJ non-delegated builds - otherwise `compileOnly` would work).
implementation(jarJar(project(":neoforge-coremods")))

clientImplementation project(path: ":neoforge", configuration: 'runtimeElements')
}

neoDev {
Expand Down Expand Up @@ -401,6 +406,16 @@ configurations {
}
}

jar {
from sourceSets.client.output
}
sourcesJar {
from sourceSets.client.allSource
}
javadoc {
source += sourceSets.client.allSource
}

processResources {
inputs.property("version", project.version)
final version = project.version
Expand Down
11 changes: 1 addition & 10 deletions testframework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ dependencies {
// TODO: is this leaking in the POM? (most likely yes)
// TODO: does this need to be changed back to runtimeDependencies?
// TODO: should use attributes to resolve the right variant instead of hardcoding
compileOnly project(path: ':neoforge', configuration: 'apiElements')
runtimeOnly project(path: ':neoforge', configuration: 'runtimeElements')
implementation project(path: ':neoforge', configuration: 'clientRuntimeElements')

compileOnly(platform("org.junit:junit-bom:${project.jupiter_api_version}"))
compileOnly "org.junit.jupiter:junit-jupiter-params"
Expand All @@ -23,14 +22,6 @@ dependencies {
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
}

sourceSets {
main {
// TODO: cursed
compileClasspath += project(':neoforge').sourceSets.main.compileClasspath
runtimeClasspath += project(':neoforge').sourceSets.main.runtimeClasspath
}
}

license {
header = rootProject.file('codeformat/HEADER.txt')
include '**/*.java'
Expand Down
2 changes: 1 addition & 1 deletion tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sourceSets {
}

dependencies {
implementation project(path: ':neoforge', configuration: 'runtimeElements')
implementation project(path: ':neoforge', configuration: 'clientRuntimeElements')
implementation(testframeworkProject)

junitImplementation(platform("org.junit:junit-bom:${project.jupiter_api_version}"))
Expand Down

0 comments on commit 4733b01

Please sign in to comment.