Anurag Benjwal
03/05/2025, 12:05 PMVampire
03/05/2025, 12:07 PMAnurag Benjwal
03/05/2025, 12:10 PMAnurag Benjwal
03/05/2025, 12:11 PMVampire
03/05/2025, 12:11 PMfoo()
with foo
being a File
instanceVampire
03/05/2025, 12:12 PMartifact sourcesFile {
classifier "sources"
}
Anurag Benjwal
03/05/2025, 12:13 PMVampire
03/05/2025, 12:13 PMVampire
03/05/2025, 12:13 PMartifact
calls are bad practice anyway.Anurag Benjwal
03/05/2025, 12:14 PMVampire
03/05/2025, 12:15 PMjava {
withSourcesJar()
withJavadocJar()
}
and publish components.java
in the publication, you automatically get tasks for sources and javadoc and proper publishing configuration including proper Gradle Module Metadata.Vampire
03/05/2025, 12:15 PMSo I am using Eclipse IDEWell, poor you. 🙂 You could still use a good IDE for your build scripts though. 🙂
Anurag Benjwal
03/05/2025, 12:16 PMVampire
03/05/2025, 12:16 PMAnurag Benjwal
03/05/2025, 12:18 PMVampire
03/05/2025, 12:20 PMartifact(sourcesFile) {
classifier "sources"
}
or something like that.
But as I said, Groovy DSL is very lenient in what you can write that will fail later and you do not have significant IDE support even with better IDEs.
And I'm not often using those bad-practice methods, as you should properly model a component with variants and publish that instead of just pure artifacts.Anurag Benjwal
03/05/2025, 12:22 PMAnurag Benjwal
03/05/2025, 12:24 PM