2
2
* Generate a JDiff report between the current version and an older version.
3
3
*
4
4
* Usage:
5
- * gradle jdiff [ -D OLD_VERSION=3.1.3.RELEASE] -D OLD_VERSION_ROOT=/path/to/3.1.3.RELEASE
5
+ * gradle jdiff -D OLD_VERSION=3.1.3.RELEASE -D OLD_VERSION_ROOT=/path/to/3.1.3.RELEASE
6
6
*
7
7
* View generated report at:
8
8
* build/reports/jdiff/changes.html
9
9
*
10
- * @param OLD_VERSION optional, defaulting to value of `previousVersion` in gradle.properties
10
+ * @param OLD_VERSION required
11
11
* @param OLD_VERSION_ROOT required, typically pointing to a separate git clone dir
12
12
*/
13
13
task jdiff {
@@ -21,17 +21,18 @@ task jdiff {
21
21
classname : " jdiff.JDiffAntTask" ,
22
22
classpath : " ${ jdiffHome} /antjdiff.jar" )
23
23
24
- def previousVersion = rootProject. previousVersion
25
-
26
24
def currentVersion = rootProject. version
27
25
def currentVersionRoot = rootProject. rootDir
28
26
29
- def oldVersion = System . getProperty(" OLD_VERSION" ) ?: previousVersion
27
+ def oldVersion = System . getProperty(" OLD_VERSION" )
30
28
def oldVersionRoot = System . getProperty(" OLD_VERSION_ROOT" )
31
29
32
30
def outputDir = " ${ rootProject.buildDir} /reports/jdiff/${ oldVersion} _to_${ currentVersion} "
33
31
34
32
doLast {
33
+ if (oldVersion == null )
34
+ throw new IllegalArgumentException (
35
+ " Set OLD_VERSION property to indicate older of the two versions being compared" )
35
36
if (oldVersionRoot == null )
36
37
throw new IllegalArgumentException (
37
38
" Set OLD_VERSION_ROOT property to indicate the root directory for ${ oldVersion} " )
0 commit comments