Skip to content

Commit

Permalink
Fix shadowJar
Browse files Browse the repository at this point in the history
  • Loading branch information
alikemalocalan committed Jan 20, 2024
1 parent d084484 commit 60c34d6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 19 deletions.
13 changes: 0 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ dependencies {
implementation 'ch.qos.logback:logback-classic:1.4.14'
}

jar {
from 'resources', {
into 'resources'
}
manifest {
attributes 'Main-Class': projectMainClassName
}
}
/* pom {
project {
inceptionYear '2008'
Expand All @@ -66,10 +58,6 @@ jar {
}
}.writeTo("pom.xml") */

task copyResources(type: Copy) {
from "${projectDir}/src/main/resources"
into "${buildDir}/classes/kotlin/main/META-INF"
}

kotlin {
jvmToolchain(11)
Expand All @@ -80,7 +68,6 @@ shadowJar {
archiveClassifier.set('')
archiveVersion.set('')
}
shadowJar.dependsOn copyResources

task sourcesJar(type: Jar, dependsOn: classes) {
//noinspection GroovyAccessibility //alternatively replace this with archiveClassifier.set('...')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.alikemalocalan.greentunnel4jvm.gui

import ch.qos.logback.classic.util.ContextInitializer
import ch.qos.logback.classic.ClassicConstants
import com.github.alikemalocalan.greentunnel4jvm.MainForm
import javax.swing.SwingUtilities

Expand All @@ -11,7 +11,7 @@ object Gui {

@JvmStatic
fun main(args: Array<String>) {
System.setProperty(ContextInitializer.CONFIG_FILE_PROPERTY, "gui-log-config.xml")
System.setProperty(ClassicConstants.CONFIG_FILE_PROPERTY, "gui-log-config.xml")

SwingUtilities.invokeAndWait {
mainFrom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ object HttpServiceUtils {
private fun parseHttpRequestFromByteBuf(reqAsString: String): HttpRequest {
val firstLine = reqAsString.split("\r\n").first().split(" ")
val method = firstLine[0]
val host = firstLine[1].toLowerCase()
val host = firstLine[1].lowercase()
val protocolVersion = firstLine[2]
return if (method.toUpperCase().startsWith("CONNECT")) { // Https request
return if (method.lowercase().startsWith("CONNECT")) { // Https request
val uri: URI = if (host.startsWith("https://")) URI(host) else URI("https://$host")
HttpRequest(method, uri, port = 443, protocolVersion = protocolVersion, isHttps = true)
} else { // Http request
Expand Down Expand Up @@ -92,7 +92,7 @@ object HttpServiceUtils {
@JvmStatic
fun makeUpperRandomChar(str: String): String {
val char = str.elementAt(Random().nextInt(str.length))
return str.replace(char, char.toUpperCase())
return str.replace(char, char.uppercaseChar())
}

@JvmStatic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object SystemProxyUtil {

@JvmStatic
fun getSystemProxySetting(): ProxySetting {
val operatingSystem = System.getProperty("os.name").toLowerCase()
val operatingSystem = System.getProperty("os.name").lowercase()
return when {
operatingSystem.contains("win") -> WindowProxySetting()
operatingSystem.contains("mac") -> DarwinProxySetting()
Expand Down

0 comments on commit 60c34d6

Please sign in to comment.