因为呀,我们模组开发者的双手都比较高贵
所以呢,Mod构建完之后是不能手动去打开libs文件夹的
于是就可以在项目下的build.gradle文件末尾加上一段代码
tasks.build {
doLast {
def libsDir = file("$buildDir/libs")
if (libsDir.exists()) {
if (System.getProperty("os.name").toLowerCase().contains("win")) {
// Windows
exec {
commandLine 'cmd', '/c', 'start', libsDir
}
} else if (System.getProperty("os.name").toLowerCase().contains("mac")) {
// macOS
exec {
commandLine 'open', libsDir
}
} else {
// Linux
exec {
commandLine 'xdg-open', libsDir
}
}
} else {
println "Could not open directory: $libsDir"
}
}
}
添加完后保存,这样在下次执行完build之后就会自动打开libs文件夹了!