File: build.gradle

package info (click to toggle)
sqljet 1.1.10-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 6,364 kB
  • sloc: java: 36,711; ansic: 695; xml: 232; makefile: 31; sh: 19; sql: 14; php: 4
file content (66 lines) | stat: -rw-r--r-- 1,819 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
apply plugin: 'osgi'

project.ext {
    bundleClasspath = []
    bundleName = rootProject.group
    bundleVersion = buildVersion.getFullOSGIVersion()
    bundleVendor = 'TMate Software'
}

def inlinedArtifacts = []
def allArtifacts = []

artifacts {
    maven jar
    osgi jar
}

classes << {
    configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.moduleArtifacts.each { jar ->
        jar.file.each {
            inlinedArtifacts.add it
            copy {
                from zipTree(jar.file[0])
                into sourceSets.main.output.classesDir
                exclude 'META-INF/**'
            }
        }
    }
    configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.allModuleArtifacts.each { jar ->
        jar.file.each { allArtifacts.add it }
    }
    allArtifacts -= inlinedArtifacts
    jar.ext.bundleClasspath = []
    allArtifacts.each {
        jar.ext.bundleClasspath += it.name
    }
}

jar {
    baseName = bundleName
    from allArtifacts
    exclude {
        return inlinedArtifacts.contains(it.file)
    }
    eachFile fullJarNameExpander
    metaInf {
        from rootProject.file('LICENSE-ANTLR.txt')
    }
    manifest {
        attributes 'Bundle-SymbolicName': bundleName,
                'Bundle-Version': bundleVersion,
                'Bundle-Vendor': bundleVendor,
                'Bundle-RequiredExecutionEnvironment' : 'J2SE-' + targetCompatibility

        instruction 'Export-Package', '*;version=' + bundleVersion
        instruction 'Import-Package', '!*'
    }
} << {
    def classpathValue = '.'
    jar.ext.bundleClasspath.each { classpathValue += ", $it" }
    ant.jar(destfile: jar.archivePath, update:true) {
        delegate.manifest {
            attribute(name: 'Bundle-ClassPath', value: classpathValue)
        }
    }
}