Skip to content

Commit

Permalink
Merge pull request #601 from hexagonkt/develop
Browse files Browse the repository at this point in the history
Small fixes
  • Loading branch information
jaguililla committed Jan 19, 2023
2 parents d76eac4 + 5655397 commit 463c76e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions core/src/main/kotlin/com/hexagonkt/core/Network.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ fun URL.exists(): Boolean =
}

fun URL.firstVariant(vararg suffixes: String): URL {
val extension = file.substringAfter('.').println()
val fileName = file.removeSuffix(".$extension").println()
val extension = file.substringAfter('.')
val fileName = file.removeSuffix(".$extension")

suffixes.forEach {
val u = URL("$protocol:$fileName$it.$extension".println())
val u = URL("$protocol:$fileName$it.$extension")
if (u.exists())
return u
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ org.gradle.warning.mode=all
org.gradle.console=plain

# Gradle
version=2.4.4
version=2.4.5
group=com.hexagonkt
description=The atoms of your platform

Expand Down
7 changes: 5 additions & 2 deletions gradle/native.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ tasks.register("upx", Exec) {

final String source = "$buildDir/native/nativeCompile/${project.name}"
final String target = "$buildDir/native/${project.name}"
final String command = "upx $source -o $target"
final String os = System.getProperty("os.name").toLowerCase()
final String command =
os.contains("windows")? "upx ${source}.exe -o ${target}.exe" : "upx $source -o $target"
commandLine(command.split(" "))

doFirst {
Expand All @@ -47,8 +49,9 @@ tasks.register("zipNative", Zip) {

final String os = System.getProperty("os.name").toLowerCase()
final String arch = System.getProperty("os.arch").toLowerCase()
final String source = os.contains("windows")? "${project.name}.exe" : project.name
from("$buildDir/native")
include(project.name)
include(source)
archiveFileName.set("${project.name}-${project.version}-${os}-${arch}.zip")
destinationDirectory.set(buildDir.toPath().resolve("distributions").toFile())
}

0 comments on commit 463c76e

Please sign in to comment.