From 75f23a19adf8ddf594691ad4e4ea076e4d2c4f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Tue, 18 Sep 2018 08:22:30 -0400 Subject: [PATCH] drop use of artifactory maven repo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub Sokołowski - rename jar file to match flatDir search method - try using ivy repo to pull status-go from github - drop use of artifactory in pom.xml - move status-go version to a STATUS_GO_VERSION file - upgrade status-go to 0.16.0 - unzip with overwriting - prepare-ios: doewnload archive only if it doesn't exist - fix prepare-android and prepare-ios - use Makefile targets to make sure status-go archives exist - remove unnecessary call to make prepare-android Signed-off-by: Jakub Sokołowski --- .gitignore | 1 + Makefile | 20 +++++++-- STATUS_GO_VERSION | 1 + android/app/libs/function-0.0.1.jar | Bin 0 -> 2141 bytes android/build.gradle | 5 +-- ci/Jenkinsfile.android | 1 + ci/Jenkinsfile.combined | 1 + ci/Jenkinsfile.ios | 1 + ci/Jenkinsfile.linux | 1 + ci/Jenkinsfile.macos | 1 + ci/android.groovy | 1 - ci/mobile.groovy | 5 +-- ios/Podfile | 3 -- .../react-native-status/android/build.gradle | 9 ++++- .../desktop/CMakeLists.txt | 1 - .../react-native-status/ios/RCTStatus/pom.xml | 38 ------------------ scripts/bundle-status-go.sh | 6 +-- 17 files changed, 39 insertions(+), 56 deletions(-) create mode 100644 STATUS_GO_VERSION create mode 100644 android/app/libs/function-0.0.1.jar delete mode 100644 modules/react-native-status/ios/RCTStatus/pom.xml 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 0000000000000000000000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&v07#z@FjXT8K%{~Vw*jD{4Pk&Yb_0+y6U-#+MIFqnC5^QN zOhPUAki!x^n}doH2oPZS|G$(8DK=mQ3(Qg2ix!0DMVOkA3mV+UfQlM~F*orUgEg$M z6+JK$mo!QOlM6hBLHvYp7Ti2&L4*h@?70+StSbw##v<};fHx}}$OIlB^aDEUC(sNA F1_1T^S@Zw^ literal 0 HcmV?d00001 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