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