-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert the project to gradle kotlin dsl #51
Conversation
But Gradle used to work, just call shadowJar. The problem is uploading it right to a repository, jitpack or mavencentral. |
I'm trying to figure it out, that's why I have it as draft. |
Oh ok let me know! |
Hey @unldenis , I believe I successfully configured it for publication on JitPack. I tested it by using the latest commit build from JitPack on the example module, and it compiled successfully:
If you're considering merging it, please check if it meets your own standards. Additionally, I didn't focus on making the commits look polished as they were primarily test commits. It might be a good idea to squash them for a cleaner history. Thanks! |
thank you very much, but I can ask you two questions:
|
I've switched all Gradle scripts to use gradle.kts, but I'm a bit stuck with the gradle/publish.gradle file. Not sure how to convert the shadow JAR publication to Kotlin. Anyway, everything else seems to work just fine!! |
Any reason why it should be gradle kotlin ? @unldenis |
} | ||
|
||
tasks { | ||
withType<ShadowJar> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tasks.shadowJar {
// ...
}
relocate("org.jetbrains.annotations", "org.holoeasy.annotations") | ||
} | ||
|
||
named("build") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tasks.build {
// ...
}
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension | ||
|
||
plugins { | ||
id("org.jetbrains.kotlin.jvm") version "1.9.22" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id("org.jetbrains.kotlin.jvm") version "1.9.22" | |
kotlin("jvm") version "1.9.22" |
@@ -0,0 +1,31 @@ | |||
plugins { | |||
id("org.jetbrains.kotlin.jvm") version "1.9.22" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id("org.jetbrains.kotlin.jvm") version "1.9.22" | |
kotlin("jvm") version "1.9.22" |
} | ||
|
||
dependencies { | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.22") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.22") |
The dependency already exists by default
tasks.jar { | ||
manifest { | ||
attributes( | ||
"Main-Class" to "MainKt" | ||
) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tasks.jar { | |
manifest { | |
attributes( | |
"Main-Class" to "MainKt" | |
) | |
} | |
} |
I don't think it's necessary to set the main class?
group = "org.holoeasy" | ||
version = "1.0-SNAPSHOT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
group = "org.holoeasy" | |
version = "1.0-SNAPSHOT" |
Sorry for the late reply, but since I didn't receive the notification and, despite having also opened the PR every now and then, I never read this message. |
Check #68 |
Changes may be required.
Compile command:
./gradlew clean build shadowJar
closes (#50)