fix issues in gradle setups
This commit is contained in:
parent
9dfd4947e4
commit
bb0f2345d0
48
build.gradle
48
build.gradle
|
|
@ -147,21 +147,49 @@ sourceSets {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
def modsTomlSpec = copySpec{
|
||||||
exclude '**/*.xcf'
|
from(sourceSets.main.resources) {
|
||||||
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
|
||||||
include 'META-INF/mods.toml'
|
include 'META-INF/mods.toml'
|
||||||
|
|
||||||
expand 'version': project.version,
|
expand 'version': project.version,
|
||||||
'minecraft_version_min': minecraft_version_min, 'minecraft_version_max': minecraft_version_max,
|
'minecraft_version_min': minecraft_version_min,
|
||||||
'forge_version_min': forge_version_min, 'forge_version_max': forge_version_max,
|
'minecraft_version_max': minecraft_version_max,
|
||||||
'javafml_min': javafml_min, 'javafml_max': javafml_max
|
'forge_version_min': forge_version_min,
|
||||||
|
'forge_version_max': forge_version_max,
|
||||||
|
'javafml_min': javafml_min,
|
||||||
|
'javafml_max': javafml_max
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
|
||||||
exclude 'META-INF/mods.toml'
|
// need to copy into each build directory, unfortunately does not seem easy to do this automatically
|
||||||
|
def buildPaths = [
|
||||||
|
"$rootDir/out/production/resources", // IDEA
|
||||||
|
"$rootDir/bin", // Eclipse
|
||||||
|
]
|
||||||
|
|
||||||
|
// task to add mods.toml to all relevant folders
|
||||||
|
task replaceResources {
|
||||||
|
// copy for gradle
|
||||||
|
copy {
|
||||||
|
outputs.upToDateWhen { false }
|
||||||
|
with modsTomlSpec
|
||||||
|
into processResources.destinationDir
|
||||||
}
|
}
|
||||||
|
// copy for IDEs
|
||||||
|
buildPaths.each { path ->
|
||||||
|
if (new File(path).exists()) {
|
||||||
|
copy {
|
||||||
|
outputs.upToDateWhen { false }
|
||||||
|
with modsTomlSpec
|
||||||
|
into path
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
processResources {
|
||||||
|
exclude 'META-INF/mods.toml'
|
||||||
|
finalizedBy replaceResources
|
||||||
}
|
}
|
||||||
|
|
||||||
task sourcesJar(type: Jar) {
|
task sourcesJar(type: Jar) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue