|
1 | 1 | plugins { |
2 | 2 | id "io.freefair.lombok" version "4.1.2" |
| 3 | + id "com.jfrog.bintray" version "1.8.4" |
| 4 | + id 'com.intershop.gradle.scmversion' version '6.0.0' |
3 | 5 | } |
4 | 6 |
|
5 | 7 | group 'com.fortify.ssc.parser.owasp.dependencycheck' |
6 | 8 |
|
7 | 9 | apply plugin: 'java' |
8 | | -apply plugin: 'idea' |
| 10 | +sourceCompatibility = 1.8 |
| 11 | + |
| 12 | +scm { |
| 13 | + version { |
| 14 | + type = 'threeDigits' |
| 15 | + initialVersion = '1.0.0' |
| 16 | + increment = 'MINOR' |
| 17 | + continuousRelease = true |
| 18 | + } |
| 19 | +} |
9 | 20 |
|
10 | 21 | ext { |
11 | 22 | versionRegex = '(\\d+)(\\.\\d+)*' |
12 | 23 | jacksonVersion = "2.8.4" |
13 | 24 | } |
14 | 25 |
|
15 | | -// plugin version, note the version must match versionRegex. |
16 | | -version = '1.0' |
| 26 | +def getDate() { |
| 27 | + new Date().format('yyyyMMddHHmmssSSS') |
| 28 | +} |
| 29 | + |
| 30 | +// Project version based on SCM information |
| 31 | +// Reg-ex to generate format <major>.<minor>[.<date>] |
| 32 | +// With date part only added for snapshot versions |
| 33 | +version = scm.version.version \ |
| 34 | + .replaceFirst(/^(\d+\.)(\d+).+?(-SNAPSHOT)?$/, '$1$2$3') \ |
| 35 | + .replaceFirst(/-SNAPSHOT/, ".00${getDate()}") |
17 | 36 |
|
18 | 37 | if (!project.hasProperty('release')) { |
19 | 38 | // Gradle has been run without option -Prelease - auto increment plugin version |
@@ -65,9 +84,9 @@ dependencies { |
65 | 84 | jar { |
66 | 85 | doFirst { |
67 | 86 | // check if version matches requirements |
68 | | - if (!version.matches(versionRegex)) { |
69 | | - throw new InvalidUserDataException("Plugin version '$version' does not match '$versionRegex'") |
70 | | - } |
| 87 | + //if (!version.matches(versionRegex)) { |
| 88 | + // throw new InvalidUserDataException("Plugin version '$version' does not match '$versionRegex'") |
| 89 | + //} |
71 | 90 | } |
72 | 91 | // replace version placeholders in plugin.xml |
73 | 92 | filesMatching('plugin.xml') { |
|
79 | 98 | from { configurations.compileExport.collect { it.isDirectory() ? it : zipTree(it).matching { exclude 'META-INF/*' } } } |
80 | 99 | } |
81 | 100 |
|
| 101 | +bintray { |
| 102 | + user = System.getenv('BINTRAY_USER') |
| 103 | + key = System.getenv('BINTRAY_KEY') |
| 104 | + publish = true |
| 105 | + pkg { |
| 106 | + repo = 'binaries' |
| 107 | + name = 'fortify-ssc-parser-owasp-dependency-check' |
| 108 | + licenses = ['MIT'] |
| 109 | + vcsUrl = 'https://github.com/fortify-ps/fortify-ssc-parser-owasp-dependency-check.git' |
| 110 | + userOrg = 'fortify-ps' |
| 111 | + version { |
| 112 | + name = project.version |
| 113 | + } |
| 114 | + } |
| 115 | + filesSpec { |
| 116 | + from("build/libs") { |
| 117 | + include "*.jar" |
| 118 | + } |
| 119 | + into '.' |
| 120 | + } |
| 121 | +} |
| 122 | + |
0 commit comments