|
1 | 1 | plugins { |
2 | 2 | id "io.freefair.lombok" version "4.1.2" |
3 | 3 | id "com.jfrog.bintray" version "1.8.4" |
4 | | - id 'com.intershop.gradle.scmversion' version '6.0.0' |
| 4 | + id 'org.ajoberstar.grgit' version "4.0.0" |
5 | 5 | } |
6 | 6 |
|
| 7 | +apply from: "https://raw.githubusercontent.com/fortify-ps/gradle-helpers/master/version-helper.gradle" |
| 8 | + |
7 | 9 | group 'com.fortify.ssc.parser.owasp.dependencycheck' |
8 | 10 |
|
9 | 11 | apply plugin: 'java' |
10 | 12 | sourceCompatibility = 1.8 |
11 | 13 |
|
12 | | -scm { |
13 | | - version { |
14 | | - type = 'threeDigits' |
15 | | - initialVersion = '1.0.0' |
16 | | - increment = 'MINOR' |
17 | | - } |
18 | | -} |
19 | | - |
20 | 14 | ext { |
21 | 15 | versionRegex = '(\\d+)(\\.\\d+)*' |
22 | 16 | jacksonVersion = "2.8.4" |
23 | 17 | } |
24 | 18 |
|
25 | | -def getDateTime() { |
26 | | - new Date().format('yyyyMMddHHmmssSSS') |
27 | | -} |
28 | | - |
29 | | -// Get the SSC plugin version based on current SCM version. |
30 | | -// Due to SSC plugin version length restrictions, we cannot |
31 | | -// use the full date/time as part of the version number for |
32 | | -// snapshot versions. As such, we use the number of hours |
33 | | -// since Epoch. |
34 | | -def getPluginVersion() { |
35 | | - def time = System.currentTimeMillis().intdiv(1000) |
36 | | - def hours = time.intdiv(3600) |
37 | | - return scm.version.version \ |
38 | | - .replaceFirst(/^(\d+\.)(\d+).+?(-SNAPSHOT)?$/, '$1$2$3') \ |
39 | | - .replaceFirst(/-SNAPSHOT/, ".${hours}") |
40 | | -} |
41 | | - |
42 | | -// Get the project version; this is used for both the jar file |
43 | | -// name and the version on Bintray. As Bintray version needs to |
44 | | -// be unique, we can't use getPluginVersion() defined above |
45 | | -// (since uploading multiple versions within a single hour would fail). |
46 | | -def getProjectVersion() { |
47 | | - return scm.version.version \ |
48 | | - .replaceFirst(/^(\d+\.)(\d+).+?(-SNAPSHOT)?$/, '$1$2$3-release') \ |
49 | | - .replaceFirst(/-SNAPSHOT-release/, "-beta-${getDateTime()}") |
50 | | -} |
51 | | - |
52 | 19 | // Project and plugin version based on SCM information |
53 | | -version = getProjectVersion() |
54 | | -def sscPluginVersion = getPluginVersion() |
| 20 | +version = getProjectVersionAsBetaOrRelease() |
| 21 | +def sscPluginVersion = getProjectVersionAsPlainVersionNumber() |
55 | 22 |
|
56 | 23 | repositories { |
57 | 24 | mavenLocal() |
|
0 commit comments