Skip to content

Commit

Permalink
Improve Gradle build script
Browse files Browse the repository at this point in the history
  • Loading branch information
Hantonik committed Aug 29, 2024
1 parent 4a1e8b2 commit 50d981c
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ subprojects {
apply plugin: 'net.darkhax.curseforgegradle'
apply plugin: 'com.modrinth.minotaur'

java {
withSourcesJar()

sourceCompatibility = JavaVersion."VERSION_$java_version"
targetCompatibility = JavaVersion."VERSION_$java_version"
}

evaluationDependsOn(':Common')
}

Expand All @@ -44,7 +37,14 @@ subprojects {
apply plugin: 'idea'
apply plugin: 'maven-publish'

java.toolchain.languageVersion = JavaLanguageVersion.of(java_version)
java {
toolchain.languageVersion = JavaLanguageVersion.of(java_version)

withSourcesJar()

sourceCompatibility = JavaVersion."VERSION_$java_version"
targetCompatibility = JavaVersion."VERSION_$java_version"
}

idea {
module {
Expand All @@ -57,6 +57,12 @@ subprojects {
version = gradleutils.version.toString()
group = "hantonik.$mod_id"

tasks.withType(JavaCompile).configureEach {
source project(':Common').sourceSets.main.allSource

options.encoding = 'UTF-8'
}

tasks.withType(ProcessResources).configureEach {
from project(':Common').sourceSets.main.resources

Expand All @@ -76,12 +82,6 @@ subprojects {
}
}

tasks.withType(JavaCompile).configureEach {
source project(':Common').sourceSets.main.allSource

options.encoding = 'UTF-8'
}

tasks.withType(Jar).configureEach {
manifest {
attributes([
Expand Down

0 comments on commit 50d981c

Please sign in to comment.