1 | import org.gradle.process.internal.ExecException;
|
---|
2 | apply from: 'gradle/version-functions.gradle'
|
---|
3 |
|
---|
4 | // Required attributes
|
---|
5 | def manifestAtts = [
|
---|
6 | "Created-By": System.getProperty("java.version") + " (" + System.getProperty("java.vendor") + ")",
|
---|
7 | "Gradle-Version": getGradle().getGradleVersion(),
|
---|
8 | "Plugin-Class": property('plugin.class'),
|
---|
9 | "Plugin-Date": String.format("%1\$tY-%1\$tm-%1\$tdT%1\$tH:%1\$tM:%1\$tS%1\$tz", new GregorianCalendar()),
|
---|
10 | "Plugin-Description": property('plugin.description'),
|
---|
11 | "Plugin-Mainversion": property('plugin.main.version'),
|
---|
12 | "Plugin-Version": property('plugin.svnrevision')
|
---|
13 | ]
|
---|
14 |
|
---|
15 | try {
|
---|
16 | manifestAtts["Plugin-SemVersion"] = getVersionName()
|
---|
17 | } catch (ExecException e) {
|
---|
18 | System.out.println("This is probably not a git-repository. So the semantic version number is not available.")
|
---|
19 | }
|
---|
20 |
|
---|
21 | // Optional attributes
|
---|
22 | if (hasProperty('plugin.author')) {
|
---|
23 | manifestAtts["Author"] = property('plugin.author')
|
---|
24 | }
|
---|
25 | if (hasProperty('plugin.canloadatruntime')) {
|
---|
26 | manifestAtts["Plugin-Canloadatruntime"] = property('plugin.canloadatruntime')
|
---|
27 | }
|
---|
28 | if (hasProperty('plugin.icon')) {
|
---|
29 | manifestAtts["Plugin-Icon"] = property('plugin.icon')
|
---|
30 | }
|
---|
31 | if (hasProperty('plugin.link')) {
|
---|
32 | manifestAtts["Plugin-Link"] = property('plugin.link')
|
---|
33 | }
|
---|
34 | if (hasProperty('plugin.requires')) {
|
---|
35 | manifestAtts["Plugin-Requires"] = property('plugin.requires')
|
---|
36 | }
|
---|
37 |
|
---|
38 | jar.manifest.attributes manifestAtts
|
---|