Skip to content

Commit

Permalink
TIMOB-8800 Make some changes so that apps and modules successfully bu…
Browse files Browse the repository at this point in the history
…ild in Java 7.
  • Loading branch information
billdawson committed May 2, 2012
1 parent 5b765cc commit 618602a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
11 changes: 9 additions & 2 deletions support/android/builder.py
Expand Up @@ -1337,7 +1337,7 @@ def build_generated_classes(self):
javac_command = [self.javac, '-encoding', 'utf8',
'-classpath', classpath, '-d', self.classes_dir, '-proc:none',
'-sourcepath', self.project_src_dir,
'-sourcepath', self.project_gen_dir]
'-sourcepath', self.project_gen_dir, '-source', '1.5', '-target', '1.5']
(src_list_osfile, src_list_filename) = tempfile.mkstemp()
src_list_file = os.fdopen(src_list_osfile, 'w')
src_list_file.write("\n".join(src_list))
Expand Down Expand Up @@ -1509,7 +1509,14 @@ def package_and_deploy(self):
else:
app_apk = os.path.join(self.project_dir, 'bin', 'app.apk')

output = run.run([self.jarsigner, '-storepass', self.keystore_pass, '-keystore', self.keystore, '-signedjar', app_apk, unsigned_apk, self.keystore_alias])
output = run.run([self.jarsigner,
'-sigalg', 'MD5withRSA',
'-digestalg', 'SHA1',
'-storepass', self.keystore_pass,
'-keystore', self.keystore,
'-signedjar', app_apk,
unsigned_apk,
self.keystore_alias])
run.check_output_for_error(output, r'RuntimeException: (.*)', True)
run.check_output_for_error(output, r'^jarsigner: (.*)', True)

Expand Down
6 changes: 4 additions & 2 deletions support/android/prereq.py
Expand Up @@ -17,9 +17,11 @@ def check_java():
(out,err) = subprocess.Popen(['javac','-version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()

# javac prints it's version on stderr
MIN_JAVAC = ["1", "6"]
version = err.replace("javac ", "").strip()
if not version.startswith("1.6"):
status = "JDK version %s detected, but 1.6 is required" % version
version_split = version.split(".")
if version_split < MIN_JAVAC:
status = "JDK version %s detected, but at least 1.6 is required" % version
failed = True
except Exception,e:
status = "Missing Java SDK. Please make sure Java SDK is on your PATH (exception: %s)" % e
Expand Down
4 changes: 4 additions & 0 deletions support/module/android/build.xml
Expand Up @@ -56,6 +56,8 @@
<javac
srcdir="${src}"
destdir="${classes}"
source="1.5"
target="1.5"
debug="${javac.debug}"
includeantruntime="false">
<compilerarg value="-processor"/>
Expand Down Expand Up @@ -155,6 +157,8 @@
<javac
destdir="${classes}"
debug="${javac.debug}"
source="1.5"
target="1.5"
includeantruntime="false">
<src path="${src}" />
<src path="${genjava}" />
Expand Down

0 comments on commit 618602a

Please sign in to comment.