rhodes 7.4.1 → 7.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CREDITS +3 -1
- data/LICENSE +1 -1
- data/README.md +3 -1
- data/Rakefile +52 -43
- data/SECURITY.md +19 -0
- data/appveyor.yml +60 -7
- data/azure-pipelines.yml +67 -0
- data/extensions/rhoconnect-push/ext/rhoconnect-push/platform/android/src/com/rhomobile/rhoelements/ans/ANSManager.java +2 -2
- data/lib/commonAPI/barcode/ext/platform/android/AndroidManifest.xml +3 -1
- data/lib/commonAPI/barcode/ext/platform/android/src/com/google/barcodereader/BarcodeCaptureActivity.java +11 -13
- data/lib/commonAPI/barcode/ext/platform/android/src/com/google/barcodereader/BarcodeGraphicTracker.java +1 -1
- data/lib/commonAPI/barcode/ext/platform/android/src/com/google/barcodereader/ui/camera/CameraSource.java +3 -3
- data/lib/commonAPI/barcode/ext/platform/android/src/com/google/barcodereader/ui/camera/CameraSourcePreview.java +1 -1
- data/lib/commonAPI/barcode/ext.yml +4 -8
- data/lib/commonAPI/coreapi/ext/platform/android/Rakefile +0 -12
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/Notification.java +4 -2
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationScheduler.java +3 -3
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationSingleton.java +1 -1
- data/lib/commonAPI/coreapi/ext/push.xml +5 -2
- data/lib/commonAPI/mediacapture/ext/camera.xml +4 -9
- data/lib/commonAPI/mediacapture/ext/platform/android/ApplicationFileProvider.erb +1 -1
- data/lib/commonAPI/mediacapture/ext/platform/android/ext_java.files +1 -9
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraExtension.java +0 -2
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraFactory.java +19 -24
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraObject.java +317 -729
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraRhoListener.java +240 -434
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/{CameraSingletonObject.java → CameraSingleton.java} +68 -74
- data/lib/commonAPI/printing_zebra/ext/platform/android/src/com/rhomobile/printing/zebra/impl/ZebraPrintingProviderImpl.java +2 -1
- data/lib/extensions/fcm-push/ext/android/ApplicationManifestAdds.erb +15 -17
- data/lib/extensions/fcm-push/ext/android/Rakefile +59 -34
- data/lib/extensions/fcm-push/ext/android/ext_java.files +0 -1
- data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMFacade.java +13 -17
- data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMIntentService.java +81 -80
- data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMListener.java +0 -16
- data/lib/extensions/fcm-push/ext.yml +1 -1
- data/lib/extensions/gmaps/ext/platform/android/ApplicationManifestAdds.erb +1 -0
- data/lib/extensions/gmaps/ext/platform/android/src/com/rhomobile/rhodes/gmaps/GMapActivity.java +12 -4
- data/lib/extensions/gmaps/ext.yml +3 -1
- data/platform/android/Rhodes/jni/src/MethodResultJni.cpp +4 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +3 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +3 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/StatusNotification.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +14 -14
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +18 -9
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality26.java +1 -1
- data/platform/android/build/{aab_builder.rb → aapt2_helper.rb} +94 -37
- data/platform/android/build/android.rake +124 -191
- data/platform/android/build/android_tools.rb +9 -9
- data/platform/android/build/androidcommon.rb +18 -7
- data/platform/android/build/build_tools_finder.rb +46 -0
- data/platform/android/build/config.yml +5 -0
- data/platform/android/build/dex_builder.rb +88 -0
- data/platform/android/build/hostplatform.rb +9 -0
- data/platform/android/build/manifest_generator.rb +1 -0
- data/platform/android/build/maven_deps_extractor.rb +22 -21
- data/platform/android/build/ndkwrapper.rb +80 -51
- data/platform/iphone/Classes/AppManager/AppManager.m +3 -1
- data/platform/iphone/Classes/Camera/PickImageDelegate.h +2 -0
- data/platform/iphone/Classes/Camera/PickImageDelegate.m +45 -23
- data/platform/iphone/Classes/CocoaServer/CCocoaServer.h +27 -0
- data/platform/iphone/Classes/CocoaServer/CCocoaServer.m +107 -0
- data/platform/iphone/Classes/CocoaServer/RhoHTTPConnection.h +16 -0
- data/platform/iphone/Classes/CocoaServer/RhoHTTPConnection.m +226 -0
- data/platform/iphone/Classes/RhoWKWebView.mm +78 -11
- data/platform/iphone/Classes/RhoWebViewFabrique.m +6 -1
- data/platform/iphone/Classes/Rhodes.m +3 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDData.h +14 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDData.m +158 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDNumber.h +12 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDNumber.m +88 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDRange.h +56 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDRange.m +104 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPAuthenticationRequest.h +45 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPAuthenticationRequest.m +195 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPConnection.h +120 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPConnection.m +2708 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPLogging.h +136 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPMessage.h +48 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPMessage.m +113 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPResponse.h +149 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPServer.h +205 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPServer.m +772 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartFormDataParser.h +65 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartFormDataParser.m +529 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartMessageHeader.h +33 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartMessageHeader.m +86 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartMessageHeaderField.h +23 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartMessageHeaderField.m +211 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPAsyncFileResponse.h +75 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPAsyncFileResponse.m +405 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPDataResponse.h +13 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPDataResponse.m +79 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPDynamicFileResponse.h +52 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPDynamicFileResponse.m +292 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPErrorResponse.h +9 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPErrorResponse.m +38 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPFileResponse.h +25 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPFileResponse.m +237 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPRedirectResponse.h +12 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPRedirectResponse.m +73 -0
- data/platform/iphone/CocoaHTTPServer/Core/WebSocket.h +105 -0
- data/platform/iphone/CocoaHTTPServer/Core/WebSocket.m +791 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DAVConnection.h +7 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DAVConnection.m +160 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DAVResponse.h +11 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DAVResponse.m +372 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DELETEResponse.h +7 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DELETEResponse.m +49 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/PUTResponse.h +8 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/PUTResponse.m +69 -0
- data/platform/iphone/CocoaHTTPServer/LICENSE.txt +18 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaAsyncSocket/About.txt +4 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaAsyncSocket/GCDAsyncSocket.h +1226 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m +8528 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/About.txt +33 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDASLLogger.h +41 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDASLLogger.m +99 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDAbstractDatabaseLogger.h +102 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDAbstractDatabaseLogger.m +727 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDFileLogger.h +334 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDFileLogger.m +1353 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDLog.h +601 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDLog.m +1083 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDTTYLogger.h +167 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDTTYLogger.m +1479 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/ContextFilterLogFormatter.h +65 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/ContextFilterLogFormatter.m +191 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/DispatchQueueLogFormatter.h +116 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/DispatchQueueLogFormatter.m +251 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/README.txt +7 -0
- data/platform/iphone/Framework/Rhodes/Rhodes.xcodeproj/project.pbxproj +1 -1
- data/platform/iphone/RhoAppBaseLib/RhoAppBaseLib.xcodeproj/project.pbxproj +364 -0
- data/platform/iphone/rbuild/iphone.rake +4 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app.zip +0 -0
- data/platform/shared/common/RhodesApp.cpp +26 -1
- data/platform/shared/net/HttpServer.cpp +20 -0
- data/platform/shared/qt/RhoSimulator.pro +1 -1
- data/platform/shared/ruby/osx/ruby/config.h +2 -0
- data/platform/shared/ruby/win32/win32.c +10 -3
- data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
- data/rakefile.rb +52 -43
- data/res/build-tools/RhoRuby.exe +0 -0
- data/res/build-tools/aapt2/linux/aapt2 +0 -0
- data/res/build-tools/aapt2/osx/aapt2 +0 -0
- data/res/generators/templates/application/AndroidManifest.erb +2 -1
- data/res/generators/templates/application/build.yml +4 -1
- data/res/generators/templates/application/rhoconfig.txt +5 -0
- data/rhobuild.yml.example +4 -4
- data/rhodes.gemspec +1 -2
- data/version +1 -1
- metadata +80 -35
- data/lib/commonAPI/mediacapture/ext/platform/android/adds/res/drawable/camera_btn.xml +0 -14
- data/lib/commonAPI/mediacapture/ext/platform/android/adds/res/layout/camera_land.xml +0 -23
- data/lib/commonAPI/mediacapture/ext/platform/android/adds/res/layout/camera_port.xml +0 -23
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraActivity.java +0 -156
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraEclair.java +0 -227
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraGingerbread.java +0 -152
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraPreview.java +0 -183
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraSingletonEclair.java +0 -14
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraSingletonGingerbread.java +0 -60
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/ICameraObject.java +0 -20
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/ICameraSingletonObject.java +0 -8
- data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMTokenRefresherService.java +0 -27
- data/platform/android/Rhodes/AndroidManifest.xml.erb +0 -89
@@ -27,16 +27,21 @@
|
|
27
27
|
require File.dirname(__FILE__) + '/androidcommon.rb'
|
28
28
|
require File.dirname(__FILE__) + '/android_tools.rb'
|
29
29
|
require File.dirname(__FILE__) + '/apk_builder.rb'
|
30
|
-
require File.dirname(__FILE__) + '/
|
30
|
+
require File.dirname(__FILE__) + '/aapt2_helper.rb'
|
31
31
|
require File.dirname(__FILE__) + '/maven_deps_extractor.rb'
|
32
32
|
require File.dirname(__FILE__) + '/manifest_generator.rb'
|
33
33
|
require File.dirname(__FILE__) + '/eclipse_project_generator.rb'
|
34
34
|
require File.dirname(__FILE__) + '/android_studio_project_generator.rb'
|
35
35
|
require File.dirname(__FILE__) + '/android_debug.rb'
|
36
36
|
require File.dirname(__FILE__) + '/../../../lib/build/BuildConfig'
|
37
|
+
|
38
|
+
require_relative 'dex_builder'
|
39
|
+
require_relative 'build_tools_finder'
|
40
|
+
|
37
41
|
load File.dirname(__FILE__) + '/android-repack.rake'
|
38
42
|
require 'pathname'
|
39
43
|
require 'tempfile'
|
44
|
+
require 'zip'
|
40
45
|
|
41
46
|
include FileUtils
|
42
47
|
|
@@ -58,7 +63,7 @@ JAVA_PACKAGE_NAME = 'com.rhomobile.rhodes'
|
|
58
63
|
# market names (such as "Android-1.5" etc) see output of
|
59
64
|
# command "android list targets"
|
60
65
|
ANDROID_MIN_SDK_LEVEL = 21 #21 is the minimum API that supports arm64
|
61
|
-
ANDROID_SDK_LEVEL =
|
66
|
+
ANDROID_SDK_LEVEL = 31
|
62
67
|
|
63
68
|
ANDROID_PERMISSIONS = {
|
64
69
|
'audio' => ['RECORD_AUDIO', 'MODIFY_AUDIO_SETTINGS'],
|
@@ -570,29 +575,30 @@ def select_aapt2
|
|
570
575
|
end
|
571
576
|
|
572
577
|
|
573
|
-
def
|
574
|
-
|
578
|
+
def init_aapt2_helper
|
579
|
+
helper = Aapt2Helper.instance
|
575
580
|
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
+
helper.logger = $logger
|
582
|
+
helper.res_dir = $appres
|
583
|
+
helper.output_path = $targetdir
|
584
|
+
helper.dex_path = File.join( $bindir, 'classes.dex' )
|
585
|
+
helper.apk_path = File.join( $bindir, 'rhodes.ap_')
|
581
586
|
#builder.res_dirs << AndroidTools::MavenDepsExtractor.instance.res_dirs
|
582
587
|
|
583
|
-
|
584
|
-
|
585
|
-
|
588
|
+
helper.build_dir = $tmpdir
|
589
|
+
helper.androidjar = $androidjar
|
590
|
+
helper.manifest = $appmanifest
|
586
591
|
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
+
helper.aapt2 = select_aapt2
|
593
|
+
helper.bundletool = $bundletool
|
594
|
+
helper.javabin = File.join( $java, 'java' + $exe_ext )
|
595
|
+
helper.rjava_dir = $app_rjava_dir
|
596
|
+
helper.maven_deps = AndroidTools::MavenDepsExtractor.instance
|
597
|
+
helper.assets_dir = $appassets
|
592
598
|
|
593
|
-
|
599
|
+
helper.no_compress_exts = $no_compression
|
594
600
|
|
595
|
-
|
601
|
+
helper.init
|
596
602
|
end
|
597
603
|
|
598
604
|
namespace "config" do
|
@@ -748,7 +754,8 @@ namespace "config" do
|
|
748
754
|
$srcdir = File.join $tmpdir,'assets' #File.join($bindir, "RhoBundle")
|
749
755
|
|
750
756
|
$rhomanifesterb = File.join($app_path, $app_config['android']['manifest_template']) unless $app_config["android"].nil? || $app_config['android']['manifest_template'].nil?
|
751
|
-
|
757
|
+
#$rhomanifesterb = File.join $androidpath, "Rhodes", "AndroidManifest.xml.erb" if $rhomanifesterb.nil?
|
758
|
+
$rhomanifesterb = File.join $startdir, 'res', 'generators', 'templates', 'application', 'AndroidManifest.erb' if $rhomanifesterb.nil?
|
752
759
|
|
753
760
|
$appmanifest = File.join $tmpdir, "AndroidManifest.xml"
|
754
761
|
|
@@ -787,66 +794,29 @@ namespace "config" do
|
|
787
794
|
# TODO: add ruby executable for Linux
|
788
795
|
end
|
789
796
|
|
790
|
-
|
791
|
-
AndroidTools::MavenDepsExtractor.instance.set_temp_dir($tmpdir)
|
792
|
-
AndroidTools::MavenDepsExtractor.instance.set_java_home($java)
|
793
|
-
|
794
|
-
|
795
|
-
build_tools_path = nil
|
797
|
+
build_tools_ver = nil
|
796
798
|
|
797
799
|
if !$skip_checking_Android_SDK
|
798
|
-
if File.exist?(File.join($androidsdkpath, "build-tools"))
|
799
800
|
|
801
|
+
AndroidTools::MavenDepsExtractor.instance.set_logger($logger)
|
802
|
+
AndroidTools::MavenDepsExtractor.instance.set_temp_dir($tmpdir)
|
803
|
+
AndroidTools::MavenDepsExtractor.instance.set_java_home($java)
|
800
804
|
|
805
|
+
toolsver = $app_config['android']['buildtools'] if ($app_config['android'] and $app_config['android']['buildtools'])
|
806
|
+
build_tools_path = AndroidTools::findBuildToolsPath(toolsver,$androidsdkpath,$androidplatform)
|
801
807
|
|
802
|
-
|
808
|
+
$logger.info "Detected Android build tools at #{build_tools_path}"
|
803
809
|
|
804
|
-
|
805
|
-
#will try to find user-specified build tools
|
806
|
-
path = File.join($androidsdkpath,'build-tools',toolsver)
|
807
|
-
if File.directory?(path)
|
808
|
-
build_tools_path = toolsver
|
809
|
-
else
|
810
|
-
$logger.warn("Android build tools v#{toolsver} specified in build.yml were not found, will use latest")
|
811
|
-
end
|
812
|
-
end
|
813
|
-
|
814
|
-
|
815
|
-
build_tools = {}
|
810
|
+
$aapt2 = File.join(build_tools_path, "aapt2#{$exe_ext}")
|
816
811
|
|
817
|
-
|
818
|
-
|
819
|
-
next if entry == '.' or entry == '..'
|
812
|
+
$aapt = File.join(build_tools_path, "aapt#{$exe_ext}")
|
813
|
+
$aapt = File.join($androidsdkpath, "platform-tools", "aapt" + $exe_ext) unless File.exists? $aapt
|
820
814
|
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
f.each_line do |line|
|
827
|
-
build_tools[entry] = line.split('=')[1].gsub("\n",'') if line.match(/^Pkg.Revision=/)
|
828
|
-
end
|
829
|
-
end
|
830
|
-
end
|
831
|
-
|
832
|
-
latest_build_tools = build_tools.sort_by{|folder_name,sdk_version| sdk_version}.last
|
833
|
-
build_tools_path = latest_build_tools[0]
|
834
|
-
end
|
835
|
-
end
|
836
|
-
|
837
|
-
$aapt2 = nil
|
838
|
-
if build_tools_path
|
839
|
-
puts "Using Android SDK build-tools: #{build_tools_path}"
|
840
|
-
build_tools_path = File.join $androidsdkpath,'build-tools',build_tools_path
|
841
|
-
$dxjar = File.join(build_tools_path,'lib','dx.jar')
|
842
|
-
$aapt = File.join(build_tools_path, "aapt#{$exe_ext}")
|
843
|
-
$aapt2 = File.join(build_tools_path, "aapt2#{$exe_ext}")
|
844
|
-
else
|
845
|
-
$dxjar = File.join($androidsdkpath, "platforms", $androidplatform, "tools", "lib", "dx.jar")
|
846
|
-
$dxjar = File.join($androidsdkpath, "platform-tools", "lib", "dx.jar") unless File.exists? $dxjar
|
847
|
-
$aapt = File.join($androidsdkpath, "platforms", $androidplatform, "tools", "aapt" + $exe_ext)
|
848
|
-
$aapt = File.join($androidsdkpath, "platform-tools", "aapt" + $exe_ext) unless File.exists? $aapt
|
849
|
-
end
|
815
|
+
AndroidTools::DexBuilder.instance.logger = $logger
|
816
|
+
AndroidTools::DexBuilder.instance.sdk_path = $androidsdkpath
|
817
|
+
AndroidTools::DexBuilder.instance.build_tools_path = build_tools_path
|
818
|
+
AndroidTools::DexBuilder.instance.androidplatform = $androidplatform
|
819
|
+
AndroidTools::DexBuilder.instance.javabin = File.join($java, 'java'+$exe_ext)
|
850
820
|
|
851
821
|
$bundletool = File.join($startdir, "res", "build-tools", "bundletool.jar")
|
852
822
|
|
@@ -871,6 +841,7 @@ namespace "config" do
|
|
871
841
|
$keytool = File.join($java, "keytool" + $exe_ext)
|
872
842
|
$jarsigner = File.join($java, "jarsigner" + $exe_ext)
|
873
843
|
$jarbin = File.join($java, "jar" + $exe_ext)
|
844
|
+
$javabin = File.join( $java, 'java' + $exe_ext )
|
874
845
|
|
875
846
|
$keystore = nil
|
876
847
|
$keystore = $app_config["android"]["production"]["certificate"] if !$app_config["android"].nil? and !$app_config["android"]["production"].nil?
|
@@ -895,6 +866,7 @@ namespace "config" do
|
|
895
866
|
AndroidTools.jarsigner = $jarsigner
|
896
867
|
AndroidTools.zipalign = $zipalign
|
897
868
|
AndroidTools.keytool = $keytool
|
869
|
+
AndroidTools.jarbin = $jarbin
|
898
870
|
AndroidTools.apksigner = File.join(build_tools_path,'apksigner'+$bat_ext)
|
899
871
|
end
|
900
872
|
|
@@ -945,12 +917,24 @@ namespace "config" do
|
|
945
917
|
$google_classpath = AndroidTools::get_addon_classpath('Google APIs', $found_api_level)
|
946
918
|
end
|
947
919
|
|
948
|
-
AndroidTools::MavenDepsExtractor.instance.add_dependency('com.android.support:support-v4:25.2.0')
|
949
|
-
AndroidTools::MavenDepsExtractor.instance.add_dependency('org.conscrypt:conscrypt-android:2.5.1')
|
950
|
-
|
951
920
|
#setup_ndk($androidndkpath, $found_api_level, 'arm')
|
952
921
|
$abis = $app_config['android']['abis'] if $app_config["android"]
|
953
922
|
$abis = ['arm'] unless $abis
|
923
|
+
|
924
|
+
#build config
|
925
|
+
core_build_cfg = {}
|
926
|
+
|
927
|
+
begin
|
928
|
+
core_build_cfg = YAML.load_file(File.join( $builddir, 'config.yml'))
|
929
|
+
rescue Exception => e
|
930
|
+
$logger.warn "Can't read core build config: #{e.inspect}"
|
931
|
+
end
|
932
|
+
|
933
|
+
if core_build_cfg['maven_deps']
|
934
|
+
core_build_cfg['maven_deps'].each { |d|
|
935
|
+
AndroidTools::MavenDepsExtractor.instance.add_dependency( d )
|
936
|
+
}
|
937
|
+
end
|
954
938
|
end
|
955
939
|
|
956
940
|
unless $debug
|
@@ -1030,7 +1014,7 @@ namespace "config" do
|
|
1030
1014
|
mkdir_p $targetdir if not File.exists? $targetdir
|
1031
1015
|
mkdir_p $srcdir if not File.exists? $srcdir
|
1032
1016
|
|
1033
|
-
|
1017
|
+
init_aapt2_helper
|
1034
1018
|
|
1035
1019
|
print_timestamp('config:android FINISH')
|
1036
1020
|
|
@@ -1285,12 +1269,6 @@ namespace "config" do
|
|
1285
1269
|
|
1286
1270
|
AndroidTools::MavenDepsExtractor.instance.extract_all
|
1287
1271
|
|
1288
|
-
if !AndroidTools::MavenDepsExtractor.instance.have_v4_support_lib?
|
1289
|
-
v4jar = Dir.glob(File.join($androidsdkpath,'extras','android','**','v4','android-support-v4.jar'))
|
1290
|
-
raise "Support-v4 library was not found neither in SDK extras nor in m2 repository" if v4jar.size !=1
|
1291
|
-
$v4support_classpath = v4jar.first
|
1292
|
-
end
|
1293
|
-
|
1294
1272
|
|
1295
1273
|
print_timestamp('android:extensions FINISH')
|
1296
1274
|
|
@@ -1435,13 +1413,23 @@ namespace "build" do
|
|
1435
1413
|
ENV["NEON_ROOT"] = $neon_root unless $neon_root.nil?
|
1436
1414
|
ENV["CONFIG_XML"] = $config_xml unless $config_xml.nil?
|
1437
1415
|
ENV["RHO_DEBUG"] = $debug.to_s
|
1438
|
-
|
1439
|
-
|
1416
|
+
if (not $app_config["android"].nil?) and (not $app_config["android"]["fcm"].nil?)
|
1417
|
+
ENV["FCM_MPBILESDK_APP_ID"] = $app_config["android"]["fcm"]["mobilesdk_app_id"]
|
1418
|
+
ENV["FCM_PROJECT_NUMBER"] = $app_config["android"]["fcm"]["project_number"]
|
1419
|
+
ENV["FCM_CURRENT_KEY"] = $app_config["android"]["fcm"]["current_key"]
|
1420
|
+
ENV["FCM_PROJECT_ID"] = $app_config["android"]["fcm"]["project_id"]
|
1421
|
+
end
|
1440
1422
|
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1423
|
+
ENV["BARCODE_ENGINE"] = 'google' #by default
|
1424
|
+
|
1425
|
+
unless $app_config['android']&.[]('barcode_engine').nil?
|
1426
|
+
engine = $app_config['android']['barcode_engine']
|
1427
|
+
case engine
|
1428
|
+
when 'zxing'
|
1429
|
+
ENV["BARCODE_ENGINE"] = 'zxing'
|
1430
|
+
else
|
1431
|
+
raise 'Only supported barcode engines are: google(default) and zxing'
|
1432
|
+
end
|
1445
1433
|
end
|
1446
1434
|
|
1447
1435
|
$ext_android_build_scripts.each do |ext, builddata|
|
@@ -1961,16 +1949,7 @@ namespace "build" do
|
|
1961
1949
|
args << "-L\"#{File.dirname(lib)}\""
|
1962
1950
|
end
|
1963
1951
|
|
1964
|
-
|
1965
|
-
|
1966
|
-
if File.exists? libandroid_support
|
1967
|
-
args << "-L\"#{libandroid_support}\""
|
1968
|
-
args << "-landroid_support"
|
1969
|
-
puts "libandroid_support exists"
|
1970
|
-
end
|
1971
|
-
|
1972
|
-
|
1973
|
-
|
1952
|
+
|
1974
1953
|
deps = []
|
1975
1954
|
libs = []
|
1976
1955
|
|
@@ -2369,7 +2348,9 @@ namespace "build" do
|
|
2369
2348
|
$logger.debug $appres.to_s
|
2370
2349
|
$logger.debug $app_rjava_dir.to_s
|
2371
2350
|
|
2372
|
-
|
2351
|
+
unless ($rhodes_as_lib)
|
2352
|
+
Aapt2Helper.instance.build_resources( $build_bundle )
|
2353
|
+
else
|
2373
2354
|
mkdir_p $appres_flats
|
2374
2355
|
|
2375
2356
|
#walkthrough resources dir
|
@@ -2416,28 +2397,17 @@ namespace "build" do
|
|
2416
2397
|
"-R", "@" + PathToWindowsWay(flaten_list_file_path),
|
2417
2398
|
"--auto-add-overlay"
|
2418
2399
|
]
|
2400
|
+
|
2401
|
+
args << "--output-text-symbols"
|
2402
|
+
args << PathToWindowsWay(File.join($app_rjava_dir, 'R.txt'))
|
2403
|
+
args << '-v' if Rake.application.options.trace
|
2419
2404
|
|
2420
|
-
if $rhodes_as_lib
|
2421
|
-
args << "--output-text-symbols"
|
2422
|
-
args << PathToWindowsWay(File.join($app_rjava_dir, 'R.txt'))
|
2423
|
-
end
|
2424
|
-
|
2425
|
-
else #no bundle and no lib so we use old AAPT
|
2426
|
-
|
2427
|
-
args = ["package", "-f", "-M", $appmanifest, "-S", $appres, "-A", $appassets, "-I", $androidjar, "-J", $app_rjava_dir]
|
2428
|
-
args += AndroidTools::MavenDepsExtractor.instance.aapt_args
|
2429
|
-
end
|
2430
|
-
|
2431
|
-
args << '-v' if Rake.application.options.trace
|
2432
|
-
|
2433
|
-
if ($rhodes_as_lib )
|
2434
2405
|
require 'nokogiri'
|
2435
2406
|
|
2436
|
-
|
2437
|
-
|
2438
|
-
end
|
2407
|
+
FormatManifestToAarCompat($appmanifest)
|
2408
|
+
|
2439
2409
|
Jake.run($aapt2, args)
|
2440
|
-
raise 'Error in
|
2410
|
+
raise 'Error in AAPT2: ' + $aapt2 + " " + args.join(' ') unless $?.success?
|
2441
2411
|
|
2442
2412
|
#how about some comments on this magic?
|
2443
2413
|
if(File.exists?(File.join($app_rjava_dir, 'com', $vendor, $appname, 'R.java')))
|
@@ -2452,16 +2422,9 @@ namespace "build" do
|
|
2452
2422
|
res_dirs = AndroidTools::MavenDepsExtractor.instance.aapt2_res_dirs
|
2453
2423
|
res_dirs.each do |dir|
|
2454
2424
|
clear_flats(dir)
|
2455
|
-
end
|
2456
|
-
|
2457
|
-
|
2458
|
-
AabBuilder.instance.build_resources
|
2459
|
-
else
|
2460
|
-
Jake.run($aapt, args)
|
2461
|
-
raise 'Error in AAPT: R.java' unless $?.success?
|
2462
|
-
end
|
2463
|
-
|
2464
|
-
|
2425
|
+
end
|
2426
|
+
end
|
2427
|
+
|
2465
2428
|
#We should've generated R.java at this point. Now let's duplicate it for our dependencies substituting package names
|
2466
2429
|
packs = AndroidTools::MavenDepsExtractor.instance.extract_packages
|
2467
2430
|
packs.each do |p|
|
@@ -2540,7 +2503,6 @@ namespace "build" do
|
|
2540
2503
|
classpath = $androidjar
|
2541
2504
|
classpath += $path_separator + $google_classpath if $google_classpath
|
2542
2505
|
classpath += $path_separator + File.join($tmpdir, 'Rhodes')
|
2543
|
-
classpath += $path_separator + $v4support_classpath if $v4support_classpath
|
2544
2506
|
classpath += $path_separator + AndroidTools::MavenDepsExtractor.instance.classpath($path_separator)
|
2545
2507
|
|
2546
2508
|
javalibsdir = Jake.get_absolute("platform/android/lib")
|
@@ -2574,7 +2536,6 @@ namespace "build" do
|
|
2574
2536
|
classpath += $path_separator + $google_classpath if $google_classpath
|
2575
2537
|
#######################################################################
|
2576
2538
|
|
2577
|
-
classpath += $path_separator + $v4support_classpath if $v4support_classpath
|
2578
2539
|
classpath += $path_separator + AndroidTools::MavenDepsExtractor.instance.classpath($path_separator)
|
2579
2540
|
classpath += $path_separator + File.join($tmpdir, 'Rhodes')
|
2580
2541
|
Dir.glob(File.join($app_builddir, '**', '*.jar')).each do |jar|
|
@@ -2615,7 +2576,6 @@ namespace "build" do
|
|
2615
2576
|
end
|
2616
2577
|
|
2617
2578
|
print_timestamp('build:android:extensions_java FINISH')
|
2618
|
-
$android_jars << $v4support_classpath if $v4support_classpath
|
2619
2579
|
$android_jars += AndroidTools::MavenDepsExtractor.instance.jars
|
2620
2580
|
end
|
2621
2581
|
|
@@ -2816,7 +2776,7 @@ def prepare_aar_package
|
|
2816
2776
|
args = ['cvf', 'classes.jar', '-C', '.', '.']
|
2817
2777
|
jarNamesCounter = 0
|
2818
2778
|
|
2819
|
-
$allclasses = File.join($tmpdir, 'allclasses')
|
2779
|
+
$allclasses = File.join($tmpdir, '.allclasses')
|
2820
2780
|
mkdir_p $allclasses
|
2821
2781
|
|
2822
2782
|
puts "Creating classes.jar for aar package"
|
@@ -2899,11 +2859,11 @@ end
|
|
2899
2859
|
def create_bundle()
|
2900
2860
|
$logger.info "Creating android bundle"
|
2901
2861
|
|
2902
|
-
builder =
|
2862
|
+
builder = Aapt2Helper.instance
|
2903
2863
|
|
2904
|
-
builder.
|
2864
|
+
bundle = builder.build_aab
|
2905
2865
|
|
2906
|
-
signed_bundle = File.join($targetdir,"#{$appname}-bundle-signed.aab")
|
2866
|
+
signed_bundle = File.join($targetdir,"#{$appname}-bundle-signed.aab")
|
2907
2867
|
|
2908
2868
|
builder.debug = $debug
|
2909
2869
|
if $debug
|
@@ -2912,7 +2872,18 @@ def create_bundle()
|
|
2912
2872
|
builder.storepass = $storepass
|
2913
2873
|
builder.storealias = $storealias
|
2914
2874
|
end
|
2915
|
-
builder.
|
2875
|
+
builder.sign_aab( bundle, signed_bundle )
|
2876
|
+
|
2877
|
+
apk = File.join($targetdir,"#{$appname}-universal.apk")
|
2878
|
+
apks = File.join($targetdir,"#{$appname}.apks")
|
2879
|
+
Jake.run( $javabin, ["-jar", $bundletool, "build-apks","--bundle=#{signed_bundle}", "--output=#{apks}", "--mode=universal"] )
|
2880
|
+
rm apk if File.file? apk
|
2881
|
+
Zip::File.open(apks) { |zip|
|
2882
|
+
e = zip.get_entry('universal.apk')
|
2883
|
+
zip.extract(e,apk)
|
2884
|
+
}
|
2885
|
+
|
2886
|
+
|
2916
2887
|
end
|
2917
2888
|
|
2918
2889
|
namespace "package" do
|
@@ -2924,17 +2895,13 @@ namespace "package" do
|
|
2924
2895
|
next
|
2925
2896
|
end
|
2926
2897
|
|
2927
|
-
|
2928
|
-
args = []
|
2929
|
-
args << "-Xmx1024m"
|
2930
|
-
args << "-jar"
|
2931
|
-
args << $dxjar
|
2932
|
-
args << "--dex"
|
2933
|
-
args << "--output=#{$bindir}/classes.dex"
|
2898
|
+
$logger.info "Running DEX builder"
|
2934
2899
|
|
2935
2900
|
alljars = Dir.glob(File.join($app_builddir, '**', '*.jar'))
|
2936
2901
|
alljars += AndroidTools::MavenDepsExtractor.instance.jars
|
2937
2902
|
|
2903
|
+
jarsForDX = []
|
2904
|
+
|
2938
2905
|
require 'set'
|
2939
2906
|
unique_jars = Set.new
|
2940
2907
|
|
@@ -2979,7 +2946,7 @@ namespace "package" do
|
|
2979
2946
|
isFromMaven = (basename == 'classes.jar')# && Pathname.new(jar).split.include?('.m2')
|
2980
2947
|
if (!unique_jars.member?(basename)) || isFromMaven
|
2981
2948
|
if !useProguard
|
2982
|
-
|
2949
|
+
jarsForDX << jar
|
2983
2950
|
else
|
2984
2951
|
jarNamesCounter += 1
|
2985
2952
|
cp jar, File.join(proguardPreBuild, jarNamesCounter.to_s + '.jar')
|
@@ -2994,58 +2961,19 @@ namespace "package" do
|
|
2994
2961
|
progArgs << File.join(proguardDir, 'proguard.jar')
|
2995
2962
|
progArgs << '@' + proguardRules
|
2996
2963
|
Jake.run(File.join($java, 'java'+$exe_ext), progArgs)
|
2997
|
-
|
2964
|
+
jarsForDX << File.join(proguardPostBuild, "classes-processed.jar")
|
2998
2965
|
end
|
2999
2966
|
|
3000
|
-
|
3001
|
-
|
3002
|
-
unless $?.success?
|
3003
|
-
raise "Error running DX utility"
|
2967
|
+
unless AndroidTools::DexBuilder.instance.build( jarsForDX, "#{File.join($bindir,'classes.dex')}")
|
2968
|
+
raise "Error running DEX builder"
|
3004
2969
|
end
|
3005
2970
|
|
3006
2971
|
resourcepkg = $bindir + "/rhodes.ap_"
|
3007
2972
|
|
3008
|
-
|
3009
|
-
|
3010
|
-
# this task already caaled during build "build:android:all"
|
3011
|
-
#set_app_name_android($appname)
|
3012
|
-
|
3013
|
-
args = ["package", "-f", "-M", $appmanifest, "-S", $appres, "-A", $appassets, "-I", $androidjar, "-F", resourcepkg]
|
3014
|
-
args += AndroidTools::MavenDepsExtractor.instance.aapt_args
|
3015
|
-
if $no_compression
|
3016
|
-
$no_compression.each do |ext|
|
3017
|
-
args << '-0'
|
3018
|
-
args << ext
|
3019
|
-
end
|
3020
|
-
end
|
3021
|
-
|
3022
|
-
args << "--no-version-vectors"
|
3023
|
-
|
3024
|
-
Jake.run($aapt, args)
|
3025
|
-
unless $?.success?
|
3026
|
-
raise "Error running AAPT (1)"
|
3027
|
-
end
|
3028
|
-
|
3029
|
-
# Workaround: manually add files starting with '_' because aapt silently ignore such files when creating package
|
3030
|
-
args = [ Rake.application.options.trace ? "uvf" : "uf", resourcepkg]
|
3031
|
-
|
3032
|
-
skip_underscores = true
|
3033
|
-
|
3034
|
-
Dir.glob(File.join($appassets, "**/*")).each do |f|
|
3035
|
-
next unless File.basename(f) =~ /^_/
|
3036
|
-
relpath = Pathname.new(f).relative_path_from(Pathname.new($tmpdir)).to_s
|
3037
|
-
puts "Add #{relpath} to #{resourcepkg}..."
|
3038
|
-
args << relpath
|
3039
|
-
skip_underscores = false
|
3040
|
-
end
|
3041
|
-
|
3042
|
-
unless skip_underscores
|
3043
|
-
Jake.run($jarbin, args, $tmpdir)
|
3044
|
-
unless $?.success?
|
3045
|
-
raise "Error packaging assets"
|
3046
|
-
end
|
3047
|
-
end
|
2973
|
+
$logger.info "Packaging Assets and Jars"
|
3048
2974
|
|
2975
|
+
Aapt2Helper.instance.build_intermediate_apk(resourcepkg)
|
2976
|
+
|
3049
2977
|
puts "Packaging Native Libs"
|
3050
2978
|
|
3051
2979
|
args = ["uf", resourcepkg]
|
@@ -3229,11 +3157,16 @@ def run_as_spec(device_flag, uninstall_app)
|
|
3229
3157
|
AndroidTools.logclear(device_flag)
|
3230
3158
|
# Start emulator with options: hidden window display and wipe user data
|
3231
3159
|
AndroidTools.run_emulator(:hidden => true, :wipe => true) if device_flag == '-e'
|
3232
|
-
|
3160
|
+
|
3161
|
+
begin
|
3162
|
+
do_uninstall(device_flag)
|
3163
|
+
rescue Exception => e
|
3164
|
+
puts "Uninstalling application exception: " + e.to_s
|
3165
|
+
end
|
3233
3166
|
|
3234
3167
|
# Failsafe to prevent eternal hangs
|
3235
3168
|
Thread.new {
|
3236
|
-
sleep
|
3169
|
+
sleep 10000
|
3237
3170
|
if device_flag == '-e'
|
3238
3171
|
#AndroidTools.kill_adb_and_emulator
|
3239
3172
|
puts "%%% was AndroidTools.kill_adb_and_emulator !!!"
|
@@ -3484,7 +3417,7 @@ namespace "run" do
|
|
3484
3417
|
end
|
3485
3418
|
|
3486
3419
|
task :spec, :uninstall_app do |t, args|
|
3487
|
-
|
3420
|
+
Jake.decorate_spec { run_as_spec('-e', args.uninstall_app) }
|
3488
3421
|
end
|
3489
3422
|
end
|
3490
3423
|
|
@@ -760,6 +760,9 @@ def read_manifest_package(path)
|
|
760
760
|
end
|
761
761
|
module_function :read_manifest_package
|
762
762
|
|
763
|
+
def self.jarbin= v
|
764
|
+
@@jarbin=v
|
765
|
+
end
|
763
766
|
|
764
767
|
def self.jarsigner= v
|
765
768
|
@@jarsigner=v
|
@@ -973,19 +976,16 @@ module_function :read_manifest_package
|
|
973
976
|
|
974
977
|
def apk_build(sdk, apk_name, res_name, dex_name, debug)
|
975
978
|
puts "Building APK file..."
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
params = ['-
|
980
|
-
|
981
|
-
params += ['-u', '-z', res_name, '-f', dex_name]
|
979
|
+
|
980
|
+
#just put dex file to a copy of already prepared intermediate APK
|
981
|
+
cp res_name, apk_name
|
982
|
+
params = [ '-uf', apk_name, '-C', File.dirname(dex_name), File.basename(dex_name) ]
|
983
|
+
Jake.run( @@jarbin, params)
|
982
984
|
|
983
|
-
Jake.run File.join($java, "java#{HostPlatform.exe_ext}"), params
|
984
985
|
unless $?.success?
|
985
|
-
Dir.chdir prev_dir
|
986
986
|
raise 'Error building APK file'
|
987
987
|
end
|
988
|
-
|
988
|
+
|
989
989
|
end
|
990
990
|
module_function :apk_build
|
991
991
|
|
@@ -65,7 +65,7 @@ def setup_ndk(ndkpath,apilevel,abi)
|
|
65
65
|
|
66
66
|
$ndkgccver = ndk.gccver
|
67
67
|
$ndk_rev_major = ndk.rev_major
|
68
|
-
$target_toolchain = ndk.
|
68
|
+
$target_toolchain = ndk.toolchain_name
|
69
69
|
$androidndkpath = ndkpath unless $androidndkpath
|
70
70
|
|
71
71
|
$sysincludes = ndk.sysincludes apilevel, abi
|
@@ -367,7 +367,10 @@ def cc_link(outname, objects, additional = nil, deps = nil)
|
|
367
367
|
if($ndk_rev_major >= 18)
|
368
368
|
args << "-v"
|
369
369
|
args << "--target=#{$target_toolchain}#{$apilevel}"
|
370
|
-
|
370
|
+
|
371
|
+
if($ndk_rev_major < 22)
|
372
|
+
args << "-fuse-ld=gold"
|
373
|
+
end
|
371
374
|
end
|
372
375
|
|
373
376
|
localabi = "unknown"
|
@@ -399,13 +402,21 @@ def cc_link(outname, objects, additional = nil, deps = nil)
|
|
399
402
|
args << "-Wl,-z,defs"
|
400
403
|
args << "-fPIC"
|
401
404
|
args << "-Wl,-soname,#{File.basename(outname)}"
|
402
|
-
|
403
|
-
|
405
|
+
|
406
|
+
|
407
|
+
if $ndk_rev_major < 22 #sysroot is auto detected by target when using NDK >= 22
|
408
|
+
args << "--sysroot"
|
409
|
+
args << $link_sysroot
|
410
|
+
end
|
411
|
+
|
404
412
|
args << "-o"
|
405
413
|
args << "\"#{outname}\""
|
406
414
|
args += objects.collect { |x| "\"#{x}\""}
|
407
415
|
args += additional if additional.is_a? Array and not additional.empty?
|
408
|
-
|
416
|
+
|
417
|
+
if $ndk_rev_major>=22
|
418
|
+
#do nothing. clang will detect all needed linker flags by target setting
|
419
|
+
elsif($ndk_rev_major >= 18)
|
409
420
|
args << "-L#{$link_sysroot}"
|
410
421
|
args << "-Wl,-rpath-link=#{$link_sysroot}"
|
411
422
|
args << "-L#{$link_sysroot_ext}"
|
@@ -464,7 +475,7 @@ def java_compile(outpath, classpath, srclist)
|
|
464
475
|
args = []
|
465
476
|
args << "-g"
|
466
477
|
args << "-d"
|
467
|
-
args << outpath
|
478
|
+
args << "\"" + outpath + "\""
|
468
479
|
args << "-source"
|
469
480
|
args << "1.6"
|
470
481
|
args << "-target"
|
@@ -473,7 +484,7 @@ def java_compile(outpath, classpath, srclist)
|
|
473
484
|
args << "-encoding"
|
474
485
|
args << "latin1"
|
475
486
|
args << "-classpath"
|
476
|
-
args << classpath
|
487
|
+
args << "\"" + classpath + "\""
|
477
488
|
args << "@#{srclist}"
|
478
489
|
puts Jake.run(javac, args)
|
479
490
|
unless $?.success?
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module AndroidTools
|
2
|
+
def findBuildToolsPath( version, sdk_path, platform)
|
3
|
+
if File.exist?(File.join(sdk_path, "build-tools"))
|
4
|
+
|
5
|
+
build_tools_ver = nil
|
6
|
+
if version
|
7
|
+
#will try to find user-specified build tools
|
8
|
+
path = File.join(sdk_path,'build-tools',version)
|
9
|
+
if File.directory?(path)
|
10
|
+
build_tools_ver = version
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
|
15
|
+
build_tools = {}
|
16
|
+
|
17
|
+
if !build_tools_ver
|
18
|
+
Dir.foreach(File.join(sdk_path, "build-tools")) do |entry|
|
19
|
+
next if entry == '.' or entry == '..'
|
20
|
+
|
21
|
+
#Lets read source.properties file to get highest available build-tools
|
22
|
+
src_prop_path = File.join(sdk_path, "build-tools",entry,"source.properties")
|
23
|
+
next unless File.file?(src_prop_path)
|
24
|
+
|
25
|
+
File.open(src_prop_path) do |f|
|
26
|
+
f.each_line do |line|
|
27
|
+
build_tools[entry] = line.split('=')[1].gsub("\n",'') if line.match(/^Pkg.Revision=/)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
latest_build_tools = build_tools.sort_by{|folder_name,sdk_version| sdk_version}.last
|
33
|
+
build_tools_ver = latest_build_tools[0]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
if build_tools_ver
|
38
|
+
build_tools_path = File.join(sdk_path,'build-tools',build_tools_ver)
|
39
|
+
else
|
40
|
+
build_tools_path = File.join(sdk_path, "platforms", platform, "tools")
|
41
|
+
end
|
42
|
+
|
43
|
+
build_tools_path
|
44
|
+
end
|
45
|
+
module_function :findBuildToolsPath
|
46
|
+
end
|