Closed yigit closed 4 years ago
Sure, I will try to do it today.
Lmk if I can help w/ that.
If you know how to automate it, that would be very helpful. Right now I have to do it manually on the Sonatype Nexus website which is unresponsive like 80% of the time.
I tried releasing it in the usual way but that doesn't seem to work:
The Gradle maven-publish plugin isn't working with the composite build. I can build the kotlin-compile-testing-ksp jar but it's always uploading the regular kotlin-compile-testing archive to Sonatype Nexus. I'd have to figure out how to build the archive with the maven-metadata.xml manually, sign it and upload it manually.
kotlin-compile-testing-ksp jar only contains the KSP classes (as expected) and not the dependencies on kotlin-compile-testing. That means that, as a user, you have to include both the kotlin-compile-testing and kotlin-compile-testing-ksp artifacts as Gradle dependencies, which is not a bad thing, but kotlin-compile-testing-ksp depends on a version of kotlin-compile-testing that was built for Kotlin-1.4-M1 so it won't work with the regular published artifact which is still at an older Kotlin version. How can we resolve this? I guess the easiest way would be to somehow bundle the kotlin-compile-testing dependency in the kotlin-compile-testing-ksp artifact until Kotlin-1.4 is released and the regular kotlin-compile-testing artifact can be updated to 1.4. Afterwards we can distribute KSP as an "add-on" module like it is done right now.
Do you have an idea how to solve these problems? Perhaps it would be better not to use a Gradle composite build or somehow configure it differently. How much work would that entail?
hmm, 2) should work. It is OK to depend on 1.3.72 from 1.4-M1. Dependency should be included in the maven pom which will make gradle pull the main artifact as well.
1) Maybe i messed it up but I think I've tried installLocal to see if artifacts are built. I'll double check.
I'll see if I can make the whole gradle maven-publish plugin work though they have all new Publishing plugin so maybe the old one doesn't support composite builds properly. Anyways, I'm hopeful I'll be able to figure it out.
Will give it a try and let you know how it goes.
It is OK to depend on 1.3.72 from 1.4-M1
Why is that not problematic?
Dependency should be included in the maven pom which will make gradle pull the main artifact as well.
So it is not necessary to depend on both explicitly as a user?
though they have all new Publishing plugin
Can you link it? When I last checked I only found https://github.com/vanniktech/gradle-maven-publish-plugin which is not maintained very well.
I think the problem with composite build might be that the included build is a subdirectory of the main build, but perhaps they have to be sibling directories. I will try moving the core library into a submodule of the project (this has to be done in the future anyway), maybe it will work then.
It is OK to depend on 1.3.72 from 1.4-M1
Why is that not problematic?
1.4 compiler can parse 1.3 code, it is just that 1.3 compiler cannot parse 1.4. Basically you cannot depend on anything that was compiled with a newer version. That being said, afaik, it is a limitation until 1.4 ships but I'm not 100% sure on that.
Dependency should be included in the maven pom which will make gradle pull the main artifact as well.
So it is not necessary to depend on both explicitly as a user?
No, it is not necessary. I've verified this locally with my new setup. I can update the readme to remove it.
though they have all new Publishing plugin
Can you link it? When I last checked I only found https://github.com/vanniktech/gradle-maven-publish-plugin which is not maintained very well.
I was referring to the publish plugin in gradle, i didn't notice you were using a 3rd party plugin. This is the "new" stuff i was referring to: https://docs.gradle.org/current/userguide/publishing_maven.html
I think the problem with composite build might be that the included build is a subdirectory of the main build, but perhaps they have to be sibling directories. I will try moving the core library into a submodule of the project (this has to be done in the future anyway), maybe it will work then.
I've fixed and locally verified it. (I just forgot to specify an ARTIFACT_ID for KSP).
You still need to run publish twice in both folders.
This is what I've done:
cd <checkout>
./gradlew installArchives #installs main module
cd ksp
./gradlew installArchives #installs the ksp module
Here is the pom generated for the KSP module: https://gist.github.com/yigit/ee9f2fa0a236083ee7e30cfbbf037e39
After publishing artifacts locally, this is how my test gradle file looks like:
repositories {
maven("https://dl.bintray.com/kotlin/kotlin-eap")
mavenCentral()
mavenLocal()
maven("https://dl.bintray.com/kotlin/kotlin-eap")
google()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
testImplementation("com.github.tschuchortdev:kotlin-compile-testing-ksp:1.2.8")
testImplementation("junit:junit:4.12")
testImplementation("org.jetbrains.kotlin:kotlin-symbol-processing-api:1.4-M1-dev-experimental-20200626")
}
Your changes in #53 seem to have worked. I have just released com.github.tschuchortdev:kotlin-compile-testing-ksp:1.2.9
. Let me know if it works, then I'll update the README and upload the release to Github as well.
yep, looks good; thanks!
Hi, I want to pull this into AndroidX. Is it possible to ship a release w/ the KSP artifact?
Lmk if I can help w/ that.
Thanks!