import org.gradle.process.internal.ExecException; apply from: 'gradle/version-functions.gradle' // Required attributes def manifestAtts = [ "Created-By": System.getProperty("java.version") + " (" + System.getProperty("java.vendor") + ")", "Gradle-Version": getGradle().getGradleVersion(), "Plugin-Class": property('plugin.class'), "Plugin-Date": String.format("%1\$tY-%1\$tm-%1\$tdT%1\$tH:%1\$tM:%1\$tS%1\$tz", new GregorianCalendar()), "Plugin-Description": property('plugin.description'), "Plugin-Mainversion": property('plugin.main.version'), "Plugin-Version": property('plugin.svnrevision') ] try { manifestAtts["Plugin-SemVersion"] = getVersionName() } catch (ExecException e) { System.out.println("This is probably not a git-repository. So the semantic version number is not available.") } // Optional attributes if (hasProperty('plugin.author')) { manifestAtts["Author"] = property('plugin.author') } if (hasProperty('plugin.canloadatruntime')) { manifestAtts["Plugin-Canloadatruntime"] = property('plugin.canloadatruntime') } if (hasProperty('plugin.icon')) { manifestAtts["Plugin-Icon"] = property('plugin.icon') } if (hasProperty('plugin.link')) { manifestAtts["Plugin-Link"] = property('plugin.link') } if (hasProperty('plugin.requires')) { manifestAtts["Plugin-Requires"] = property('plugin.requires') } jar.manifest.attributes manifestAtts