diff --git a/.gitignore b/.gitignore index b38e4591e8..460ce6c564 100644 --- a/.gitignore +++ b/.gitignore @@ -85,6 +85,7 @@ doo-index.html Statusgo.framework status-go-local.aar status-dev-cli +status-go-*.zip #ios ios/Pods diff --git a/Makefile b/Makefile index 09699a1793..99d8de383a 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,14 @@ help: ##@other Show this help @perl -e '$(HELP_FUN)' $(MAKEFILE_LIST) +GITHUB_URL = https://github.com/status-im/status-go/releases/download +RCTSTATUS_DIR = modules/react-native-status/ios/RCTStatus +ANDROID_LIBS_DIR = android/app/libs +STATUS_GO_VER = $(shell cat STATUS_GO_VERSION) + +STATUS_GO_IOS_ARCH = $(RCTSTATUS_DIR)/status-go-ios-$(STATUS_GO_VER).zip +STATUS_GO_DRO_ARCH = $(ANDROID_LIBS_DIR)/status-go-$(STATUS_GO_VER).aar + OS := $(shell uname) # This is a code for automatic help generator. @@ -47,13 +55,19 @@ _prepare-mobile: ##@prepare Install mobile platform dependencies and prepare wor scripts/prepare-for-platform.sh mobile npm install -prepare-ios: _prepare-mobile ##@prepare Install and prepare iOS-specific dependencies - mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack +$(STATUS_GO_IOS_ARCH): + cd $(RCTSTATUS_DIR) && curl -OL "$(GITHUB_URL)/v$(STATUS_GO_VER)/status-go-ios-$(STATUS_GO_VER).zip" + +$(STATUS_GO_DRO_ARCH): + cd $(ANDROID_LIBS_DIR) && curl -OL "$(GITHUB_URL)/v$(STATUS_GO_VER)/status-go-$(STATUS_GO_VER).aar" + +prepare-ios: $(STATUS_GO_IOS_ARCH) _prepare-mobile ##@prepare Install and prepare iOS-specific dependencies + cd $(RCTSTATUS_DIR) && unzip -q -o status-go-ios-$(STATUS_GO_VER).zip ifeq ($(OS),Darwin) cd ios && pod install endif -prepare-android: _prepare-mobile ##@prepare Install and prepare Android-specific dependencies +prepare-android: $(STATUS_GO_DRO_ARCH) _prepare-mobile ##@prepare Install and prepare Android-specific dependencies cd android && ./gradlew react-native-android:installArchives prepare-mobile: prepare-android prepare-ios ##@prepare Install and prepare mobile platform specific dependencies diff --git a/STATUS_GO_VERSION b/STATUS_GO_VERSION new file mode 100644 index 0000000000..04a373efe6 --- /dev/null +++ b/STATUS_GO_VERSION @@ -0,0 +1 @@ +0.16.0 diff --git a/android/app/libs/function-0.0.1.jar b/android/app/libs/function-0.0.1.jar new file mode 100644 index 0000000000..ce72f6914f Binary files /dev/null and b/android/app/libs/function-0.0.1.jar differ diff --git a/android/build.gradle b/android/build.gradle index dc9e82ba96..74920166eb 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,9 +21,8 @@ allprojects { jcenter() maven { url "$rootDir/../node_modules/react-native/android" } maven { url "$rootDir/../modules/react-native-status/android/libs" } - // for geth - flatDir { dirs 'libs' } - maven { url "http://139.162.11.12:8081/artifactory/libs-release-local" } + // for geth, function, and status-go + flatDir { dirs "libs", "${rootDir}/app/libs" } maven { url "https://jitpack.io" } google() } diff --git a/ci/Jenkinsfile.android b/ci/Jenkinsfile.android index f15331a4af..9f4fa65370 100644 --- a/ci/Jenkinsfile.android +++ b/ci/Jenkinsfile.android @@ -10,6 +10,7 @@ pipeline { } environment { + BUILD_PLATFORM = 'android' LANG = 'en_US.UTF-8' LANGUAGE = 'en_US.UTF-8' LC_ALL = 'en_US.UTF-8' diff --git a/ci/Jenkinsfile.combined b/ci/Jenkinsfile.combined index 7007ce6396..b9622cbb4f 100644 --- a/ci/Jenkinsfile.combined +++ b/ci/Jenkinsfile.combined @@ -54,6 +54,7 @@ pipeline { cmn.copyArts('status-react/combined/desktop-macos', osx.number) cmn.copyArts('status-react/combined/desktop-linux', nix.number) } + cmn.copyArts('status-react/combined/mobile-ios', ios.number) cmn.copyArts('status-react/combined/mobile-android', dro.number) cmn.copyArts('status-react/combined/mobile-android', e2e.number) cmn.copyArts('status-react/combined/mobile-ios', ios.number) diff --git a/ci/Jenkinsfile.ios b/ci/Jenkinsfile.ios index 7a4bf935c8..631a6481ac 100644 --- a/ci/Jenkinsfile.ios +++ b/ci/Jenkinsfile.ios @@ -10,6 +10,7 @@ pipeline { } environment { + BUILD_PLATFORM = 'ios' LANG = 'en_US.UTF-8' LANGUAGE = 'en_US.UTF-8' LC_ALL = 'en_US.UTF-8' diff --git a/ci/Jenkinsfile.linux b/ci/Jenkinsfile.linux index 9c3cd6db79..fa3efbb435 100644 --- a/ci/Jenkinsfile.linux +++ b/ci/Jenkinsfile.linux @@ -27,6 +27,7 @@ pipeline { * https://issues.jenkins-ci.org/browse/JENKINS-49076 **/ environment { + BUILD_PLATFORM = 'linux' LANG = 'en_US.UTF-8' LANGUAGE = 'en_US.UTF-8' LC_ALL = 'en_US.UTF-8' diff --git a/ci/Jenkinsfile.macos b/ci/Jenkinsfile.macos index 3f93510dfa..d8fc4c9e5f 100644 --- a/ci/Jenkinsfile.macos +++ b/ci/Jenkinsfile.macos @@ -10,6 +10,7 @@ pipeline { } environment { + BUILD_PLATFORM = 'macos' LANG = 'en_US.UTF-8' LANGUAGE = 'en_US.UTF-8' LC_ALL = 'en_US.UTF-8' diff --git a/ci/android.groovy b/ci/android.groovy index 070c6c562c..1976863be3 100644 --- a/ci/android.groovy +++ b/ci/android.groovy @@ -7,7 +7,6 @@ def compile(type = 'nightly') { gradleOpt += "-PreleaseVersion='${common.version()}'" } dir('android') { - sh './gradlew react-native-android:installArchives' sh "./gradlew assembleRelease ${gradleOpt}" } def pkg = common.pkgFilename(type, 'apk') diff --git a/ci/mobile.groovy b/ci/mobile.groovy index 02e15813b9..20752efc76 100644 --- a/ci/mobile.groovy +++ b/ci/mobile.groovy @@ -47,11 +47,10 @@ def prep(type = 'nightly') { default: sh 'cp .env.jenkins .env'; break } - common.installJSDeps('mobile') /* install ruby dependencies */ sh 'bundle install --quiet' - /* install Maven dependencies */ - sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack' + /* npm deps and status-go download */ + sh "make prepare-${env.BUILD_PLATFORM}" /* generate ios/StatusIm.xcworkspace */ dir('ios') { podUpdate() diff --git a/ios/Podfile b/ios/Podfile index a8f47379ab..4cc7f65857 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -8,9 +8,6 @@ target 'StatusIm' do # Uncomment the next line if you're using Swift or would like to use dynamic frameworks # use_frameworks! - # Fix for CocoaPods/issues/8110 - pod 'GoogleUtilities/MethodSwizzler', '5.2.0' - # Pods for StatusIm pod 'Firebase/Core' pod 'Firebase/Messaging' diff --git a/modules/react-native-status/android/build.gradle b/modules/react-native-status/android/build.gradle index dd6b531ca5..b3234b10fa 100644 --- a/modules/react-native-status/android/build.gradle +++ b/modules/react-native-status/android/build.gradle @@ -1,5 +1,10 @@ apply plugin: 'com.android.library' +def getStatusGoVersion = { -> + version = new File('../STATUS_GO_VERSION').text + return version.replaceAll("\\s","") +} + android { compileSdkVersion 26 @@ -16,7 +21,9 @@ dependencies { implementation 'com.instabug.library:instabug:3+' implementation 'status-im:function:0.0.1' - String statusGoVersion = 'v0.16.0-1-gf3880f8f' + // WARNING: If you change this, make sure the GitHub release of the .aar exists. + // WARNING: status-go is downloaded in Makefile and has a hardcoded version too. + String statusGoVersion = getStatusGoVersion() final String statusGoGroup = 'status-im', statusGoName = 'status-go' // Check if the local status-go jar exists, and compile against that if it does diff --git a/modules/react-native-status/desktop/CMakeLists.txt b/modules/react-native-status/desktop/CMakeLists.txt index 268999d762..d5b741ef44 100755 --- a/modules/react-native-status/desktop/CMakeLists.txt +++ b/modules/react-native-status/desktop/CMakeLists.txt @@ -38,7 +38,6 @@ ExternalProject_Add(StatusGo_ep SOURCE_DIR ${StatusGo_SOURCE_DIR} GIT_REPOSITORY https://github.com/status-im/status-go.git GIT_TAG f3880f8fe1f11e2cd59382c34dd826ebbf9662cf - BUILD_BYPRODUCTS ${StatusGo_STATIC_LIB} CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${CONFIGURE_SCRIPT} ${GO_ROOT_PATH} ${StatusGo_ROOT} ${StatusGo_SOURCE_DIR} BUILD_COMMAND "" diff --git a/modules/react-native-status/ios/RCTStatus/pom.xml b/modules/react-native-status/ios/RCTStatus/pom.xml deleted file mode 100644 index f2b1c7ce8b..0000000000 --- a/modules/react-native-status/ios/RCTStatus/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - 4.0.0 - - org.reactjs.native.example - Messenger - 1.0-SNAPSHOT - - - - ci.status.im - http://139.162.11.12:8081/artifactory/libs-release-local/ - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - 2.10 - - - - status-im - status-go-ios-simulator - v0.16.0-1-gf3880f8f - zip - true - ./ - - - - - - - diff --git a/scripts/bundle-status-go.sh b/scripts/bundle-status-go.sh index 38353089c5..2ca651322a 100755 --- a/scripts/bundle-status-go.sh +++ b/scripts/bundle-status-go.sh @@ -40,8 +40,8 @@ for platform in "$@"; do # > (cd status-go && find . -iname "Statusgo.framework") # ./build/bin/statusgo-ios-9.3-framework/Statusgo.framework # - # Normally this is installed by Maven via Artifactory in this step - # mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack + # You can get this by running: + # make prepare-{ios,android} # # Locally you can see it here: # > (cd status-react && find . -iname "Statusgo.framework") @@ -85,4 +85,4 @@ for platform in "$@"; do echo "[Done]" ;; esac -done \ No newline at end of file +done