Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] run vendor submodule check
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasPaczos committed Jan 29, 2019
1 parent e598146 commit 54e3303
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions platform/android/gradle/android-nitpick.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,33 @@ def MAPBOX_TELEMETRY_TAG_PREFIX = 'telem-'
def MAPBOX_GESTURES_DIR = 'mapbox-gestures-android'
def MAPBOX_GESTURES_TAG_PREFIX = 'v'

task verifyVendorSubmodulePins {
task androidNitpick {
doLast {
println "Running android nitpick script"

println "Verify vendor submodule pins"
exec {
workingDir = "${rootDir}"
commandLine "git", "submodule", "update", "--init", "--recursive", "vendor"
}
verifyVendorSubmodulePin(MAPBOX_JAVA_DIR, MAPBOX_JAVA_TAG_PREFIX, versions.mapboxServices)
verifyVendorSubmodulePin(MAPBOX_TELEMETRY_DIR, MAPBOX_TELEMETRY_TAG_PREFIX, versions.mapboxTelemetry)
verifyVendorSubmodulePin(MAPBOX_GESTURES_DIR, MAPBOX_GESTURES_TAG_PREFIX, versions.mapboxGestures)
}
}

task androidNitpick {
doLast {
println "Running android nitpick script"
verifyVendorSubmodulePins
}
}

private def verifyVendorSubmodulePin(def dir, def prefix, def version) {
def output = new ByteArrayOutputStream()
exec {
workingDir "${rootDir}/vendor/${dir}"
workingDir = "${rootDir}/vendor/${dir}"
commandLine "git", "rev-list", "-n", "1", "tags/${prefix + version}"
standardOutput = output
}
def expectedCommit = output.toString().trim()
output.reset()

exec {
workingDir "${rootDir}/vendor/${dir}"
workingDir = "${rootDir}/vendor/${dir}"
commandLine "git", "rev-parse", "HEAD"
standardOutput = output
}
Expand Down

0 comments on commit 54e3303

Please sign in to comment.