@@ -148,10 +148,6 @@ class BaseBuildPlugin implements Plugin<Project> {
148
148
if (! project. rootProject. ext. has(' settingsConfigured' )) {
149
149
// Force any Elasticsearch test clusters to use packaged java versions if they have them available
150
150
project. rootProject. ext. isRuntimeJavaHomeSet = false
151
-
152
- File gitHead = gitBranch(project)
153
- project. rootProject. ext. gitHead = gitHead
154
- project. rootProject. ext. revHash = gitHash(gitHead)
155
151
project. rootProject. ext. settingsConfigured = true
156
152
157
153
// TODO: Forward Port?
@@ -163,8 +159,6 @@ class BaseBuildPlugin implements Plugin<Project> {
163
159
// params.setIsRutimeJavaHomeSet(project.rootProject.ext.isRuntimeJavaHomeSet)
164
160
// }
165
161
}
166
- project. ext. gitHead = project. rootProject. ext. gitHead
167
- project. ext. revHash = project. rootProject. ext. revHash
168
162
project. ext. javaVersions = BuildParams . javaVersions
169
163
project. ext. isRuntimeJavaHomeSet = project. rootProject. ext. isRuntimeJavaHomeSet
170
164
}
@@ -216,44 +210,4 @@ class BaseBuildPlugin implements Plugin<Project> {
216
210
}
217
211
// End section
218
212
}
219
-
220
- /**
221
- * @param project that belongs to a git repo
222
- * @return the file containing the hash for the current branch
223
- */
224
- private static File gitBranch (Project project ) {
225
- // parse the git files to find out the revision
226
- File gitHead = project. file(" ${ project.rootDir} /.git/HEAD" )
227
- if (gitHead != null && ! gitHead. exists()) {
228
- // Try as a sub module
229
- File subModuleGit = project. file(" ${ project.rootDir} /.git" )
230
- if (subModuleGit != null && subModuleGit. exists()) {
231
- String content = subModuleGit. text. trim()
232
- if (content. startsWith(" gitdir:" )) {
233
- gitHead = project. file(" ${ project.rootDir} /" + content. replace(' gitdir: ' ,' ' ) + " /HEAD" )
234
- }
235
- }
236
- }
237
-
238
- if (gitHead != null && gitHead. exists()) {
239
- String content = gitHead. text. trim()
240
- if (content. startsWith(" ref:" )) {
241
- return project. file(" ${ project.rootDir} /.git/" + content. replace(' ref: ' ,' ' ))
242
- }
243
- return gitHead
244
- }
245
- return null
246
- }
247
-
248
- /**
249
- * @param gitHead file containing the the currently checked out ref
250
- * @return the current commit version hash
251
- */
252
- private static String gitHash (File gitHead ) {
253
- String rev = " unknown"
254
- if (gitHead != null && gitHead. exists()) {
255
- rev = gitHead. text. trim()
256
- }
257
- return rev
258
- }
259
213
}
0 commit comments