Skip to content

Commit

Permalink
build: stop using local Eclipse as a part of dependency
Browse files Browse the repository at this point in the history
This change makes it possible to build Eclipse plugins without
local Eclipse IDE. It is also possible to use metadata of artifacts
(pom.xml) to maintain license, vulnerability, and version of
dependencies.

close #1868
  • Loading branch information
KengoTODA authored and hazendaz committed Oct 7, 2023
1 parent d3c49cb commit 0d333c7
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions spotbugs/build.gradle
Expand Up @@ -150,25 +150,16 @@ eclipse.classpath.file {
}
}

def copyLibsForEclipse = tasks.register('copyLibsForEclipse', Copy) {
from configurations.testCompileClasspath, configurations.testRuntimeClasspath, configurations.guiRuntimeClasspath, configurations.guiCompileClasspath, configurations.logBinding
into ".libs"
include "*.jar"
exclude "*xml-apis*.jar"
exclude "*spotbugs-annotations*.jar"
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

def updateManifest = tasks.register('updateManifest') {
inputs.file "$projectDir/META-INF/MANIFEST-TEMPLATE.MF"
outputs.file "$projectDir/META-INF/MANIFEST.MF"
dependsOn configurations.runtimeClasspath, copyLibsForEclipse
dependsOn configurations.runtimeClasspath
doLast {
def manifestSpec = manifest {
from "$projectDir/META-INF/MANIFEST-TEMPLATE.MF"
attributes 'Main-Class': 'edu.umd.cs.findbugs.LaunchAppropriateUI',
'Bundle-Version': project.version.replace('-', '.'),
'Bundle-ClassPath': 'spotbugs.jar,' + fileTree(dir: '.libs').collect { projectDir.toPath().relativize(it.toPath()).toString() }.join(',')
'Bundle-ClassPath': 'spotbugs.jar,' + configurations.runtimeClasspath.collect { it.name }.join(',')
}
// write manifests
manifestSpec.writeTo("$projectDir/META-INF/MANIFEST.MF")
Expand Down

0 comments on commit 0d333c7

Please sign in to comment.