summaryrefslogtreecommitdiff
path: root/platform/android/scripts/validate-license.py
blob: 365d7ac265e309c6a3869bad2efcbd1f1e79f310 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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.""")