mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-21 15:50:40 +00:00
Fix stupid build error and a couple gradle warnings
thank you gradle .replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() } is clearly better than .capitalize()
This commit is contained in:
@@ -5,7 +5,9 @@ import java.net.URI
|
||||
import java.net.URL
|
||||
import java.nio.file.FileSystems
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.ProviderNotFoundException
|
||||
import java.nio.file.StandardCopyOption
|
||||
import java.nio.file.spi.FileSystemProvider
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.plugins.BasePluginExtension
|
||||
@@ -46,7 +48,14 @@ fun Project.configureDistribution() {
|
||||
// https://github.com/johnrengelman/shadow/issues/111
|
||||
val dest = URI.create("jar:" + tasks.named<ShadowJar>("shadowJar").get().archiveFile.get().asFile.toURI())
|
||||
|
||||
FileSystems.newFileSystem(dest, mapOf("create" to "false"), null).use { fs ->
|
||||
val preExistingProvider = try {
|
||||
FileSystems.getFileSystem(dest)
|
||||
} catch (e: Exception) {
|
||||
null
|
||||
};
|
||||
val provider = if (preExistingProvider == null) { preExistingProvider } else { FileSystems.newFileSystem(dest, mapOf("create" to "false"), null)
|
||||
};
|
||||
provider?.use { fs ->
|
||||
forSubProjects(":common:addons") {
|
||||
val jar = getJarTask()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user