-
Notifications
You must be signed in to change notification settings - Fork 176
Description
This is my setup:
Module: checks (java-library)
Module: styling-lint (android-library
) which works like a bridge between checks and projects who implements styling-lint:
apply plugin: 'com.android.library'
apply from: rootProject.file('deploy-bintray.gradle.kts')
android {...}
dependencies { lintPublish project(':checks') }
deploy-bintray.gradle.kts it's my bintray/maven publications script. You can find the code here.
I'm having problems generating .jar files:
val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(project.the<SourceSetContainer>()["main"].allSource)
}
publications {
create<MavenPublication>(bintrayRepo) {
groupId = publishedGroupId
artifactId = artifact
version = libraryVersion
from(components["java"])
artifact(sourcesJar.get())
artifact(dokkaJar.get())
...
}
}
}
it fails with:
SoftwareComponentInternal with name 'java' not found.
or, if I comment from(components["java"])
it fails with:
SourceSet with name 'main' not found.
If I add java plugin:
The 'java' plugin has been applied, but it is not compatible with the
Android plugins.
So I'm stuck here.
I believe the problem with the sources it's related to the fact that the android-library
module has no code and it only imports the checks module by lintPublish project(':checks') }
. This setup is desired because I want the lint jar created by checks to be "auto-imported" when other projects depend (implementation
) on styling-lint project.
How can I solve this?