[android] - validate license generatrion with nitpick on CI

This commit is contained in:
tobrun
2019-03-20 18:54:34 +01:00
committed by Tobrun
parent ac6855a473
commit ee5be6dff1
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
#!/usr/bin/python
from subprocess import call
from subprocess import Popen, PIPE
import sys
## Run license generation
call('cd ../../ && make android-license', shell=True)
## Git diff changes
p = Popen(['git', 'diff', '--name-only', 'LICENSE.md'], stdin=PIPE, stdout=PIPE, stderr=PIPE)
output, err = p.communicate(b"input data that is passed to subprocess' stdin")
if "platform/android/LICENSE.md" in output:
raise ValueError("""An error ocurred while validating the license generation.
Changes were detected to the license generation output
but weren't commited. Run make android-license and
commit the changeset to make this validation pass.""")