@@ -61,8 +61,18 @@ task removeDocNav() {
61
61
}
62
62
}
63
63
64
+ task removeVersion () {
65
+ doLast {
66
+ description ' Removes current version from site-source/_pages/home.md'
67
+ File home = file(' site-source/_pages/home.md' )
68
+ String homeText = home. getText()
69
+ String homeTextWithVersion = homeText. replaceAll(/ `org.junit-pioneer : junit-pioneer : [^`]*`/ , " `org.junit-pioneer : junit-pioneer : @xp:version`" )
70
+ home. setText(homeTextWithVersion)
71
+ }
72
+ }
73
+
64
74
task clean {
65
- dependsOn removeProjectPage, removeDocs, removeDocNav
75
+ dependsOn removeProjectPage, removeDocs, removeDocNav, removeVersion
66
76
}
67
77
68
78
// ------
@@ -93,8 +103,21 @@ task insertDocNav() {
93
103
}
94
104
}
95
105
106
+ task insertVersion () {
107
+ doLast {
108
+ description ' Inserts current XP version into site-source/_pages/home.md'
109
+ Properties properties = new Properties ()
110
+ file(' junit-pioneer/version.properties' ). withInputStream { properties. load(it) }
111
+ String version = properties. previousVersion
112
+ File home = file(' site-source/_pages/home.md' )
113
+ String homeText = home. getText()
114
+ String homeTextWithVersion = homeText. replaceAll(/ @xp:version/ , " ${ version} " )
115
+ home. setText(homeTextWithVersion)
116
+ }
117
+ }
118
+
96
119
task create {
97
- dependsOn copyProjectPage, copyDocs, insertDocNav
120
+ dependsOn copyProjectPage, copyDocs, insertDocNav, insertVersion
98
121
}
99
122
100
123
// -----
0 commit comments