fix: 尝试修复构建环境配置错误
This commit is contained in:
parent
db7fe0b8f0
commit
51c9cff999
|
|
@ -41,26 +41,18 @@ clean {
|
|||
|
||||
def loaderAttribute = Attribute.of('io.github.mcgradleconventions.loader', String)
|
||||
['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements'].each { variant ->
|
||||
try {
|
||||
configurations.named(variant) {
|
||||
if (!it.isLocked()) {
|
||||
configurations.named("$variant") {
|
||||
attributes {
|
||||
attribute(loaderAttribute, 'common')
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
sourceSets.configureEach {
|
||||
[it.compileClasspathConfigurationName, it.runtimeClasspathConfigurationName].each { variant ->
|
||||
try {
|
||||
configurations.named(variant) {
|
||||
if (!it.isLocked()) {
|
||||
[it.compileClasspathConfigurationName, it.runtimeClasspathConfigurationName].each { variant->
|
||||
configurations.named("$variant") {
|
||||
attributes {
|
||||
attribute(loaderAttribute, 'common')
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,26 +136,18 @@ loom {
|
|||
|
||||
def loaderAttribute = Attribute.of('io.github.mcgradleconventions.loader', String)
|
||||
['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements', 'includeInternal', 'modCompileClasspath'].each { variant ->
|
||||
try {
|
||||
configurations.named(variant) {
|
||||
if (!it.isLocked()) {
|
||||
configurations.named("$variant") {
|
||||
attributes {
|
||||
attribute(loaderAttribute, 'fabric')
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
sourceSets.configureEach {
|
||||
[it.compileClasspathConfigurationName, it.runtimeClasspathConfigurationName].each { variant ->
|
||||
try {
|
||||
configurations.named(variant) {
|
||||
if (!it.isLocked()) {
|
||||
[it.compileClasspathConfigurationName, it.runtimeClasspathConfigurationName].each { variant->
|
||||
configurations.named("$variant") {
|
||||
attributes {
|
||||
attribute(loaderAttribute, 'fabric')
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ neoForge {
|
|||
)
|
||||
}
|
||||
data {
|
||||
data()
|
||||
clientData()
|
||||
|
||||
// DataGen can be run by - "./gradlew :neoforge:runData" in Terminal.
|
||||
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
|
||||
|
|
@ -108,28 +108,21 @@ tasks.named('build') {
|
|||
sourceSets.main.resources.srcDir project(':common').file('src/generated/resources')
|
||||
|
||||
|
||||
// Implement mcgradleconventions loader attribute
|
||||
def loaderAttribute = Attribute.of('io.github.mcgradleconventions.loader', String)
|
||||
['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements'].each { variant ->
|
||||
try {
|
||||
configurations.named(variant) {
|
||||
if (!it.isLocked()) {
|
||||
configurations.named("$variant") {
|
||||
attributes {
|
||||
attribute(loaderAttribute, 'neoforge')
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
sourceSets.configureEach {
|
||||
[it.compileClasspathConfigurationName, it.runtimeClasspathConfigurationName, it.getTaskName(null, 'jarJar')].each { variant ->
|
||||
try {
|
||||
configurations.named(variant) {
|
||||
if (!it.isLocked()) {
|
||||
configurations.named("$variant") {
|
||||
attributes {
|
||||
attribute(loaderAttribute, 'neoforge')
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user