Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Android SDK to 28 #20026

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e17704a
bump SDK to 27, support library 27.1.1
dulmandakh Jul 4, 2018
3f8dc67
circle-ci cache key is api-27
dulmandakh Jul 4, 2018
fef8613
use api-27-node8-alpha image
dulmandakh Jul 4, 2018
24115fd
fix android.arch.lifecycle:runtime sha1 sum
dulmandakh Jul 4, 2018
252345f
add android-lifecycle-viewmodel to buck
dulmandakh Jul 4, 2018
f528570
use compile dependency for android-jsc in ReactAndroid
dulmandakh Jul 4, 2018
bf46825
Merge branch 'master' into bump-sdk-27
dulmandakh Aug 6, 2018
0ec3429
RNTester to use support-annotations
dulmandakh Aug 6, 2018
5137277
remove redundant support-annotations dependency in RNTester
dulmandakh Aug 6, 2018
09d8043
RNTesterApplication to use support annotations
dulmandakh Aug 6, 2018
a0fe223
js ci to use implementation directive, instead of compile
dulmandakh Aug 6, 2018
b7ca798
js ci to use implementation directive, instead of compile
dulmandakh Aug 6, 2018
a4bc6e6
bump android sdk to 28
dulmandakh Aug 7, 2018
b204f61
circle ci to use 28 image
dulmandakh Aug 7, 2018
595ba38
use compile for android-jsc
dulmandakh Aug 7, 2018
208c00e
bump gradle to 4.6
dulmandakh Aug 7, 2018
15d872b
use gradle binary distribution
dulmandakh Aug 7, 2018
014a8f6
Revert "use gradle binary distribution"
dulmandakh Aug 7, 2018
5765cb4
bump SDK and build tools for Appveyor
dulmandakh Aug 7, 2018
eb3ce70
bump android gradle plugin to 3.1.4
dulmandakh Aug 7, 2018
c47349a
bump ANDROID_GOOGLE_API_LEVEL to 24 on CI
dulmandakh Aug 7, 2018
eb9f611
ReactAndroid to use api instead of implementation to expose its depen…
dulmandakh Aug 7, 2018
cb7c1b4
use api for android-jsc
dulmandakh Aug 7, 2018
669d94a
use compile for android-jsc
dulmandakh Aug 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buckconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

[android]
target = android-26
target = android-28

[download]
max_number_of_retries = 3
Expand Down
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ aliases:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appveyor need to change to.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gengjiawen change to what?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean windows ci need related change too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gengjiawen sorry, I have no experience of Appveyor. Please provide me exact change to make.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/facebook/react-native/blob/master/appveyor.yml, change ANDROID_BUILD_VERSION and ANDROID_TOOLS_VERSION is okay

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- &restore-cache-android-packages
keys:
- v1-android-sdkmanager-packages-api-26-alpha-{{ checksum "scripts/.tests.env" }}
- v1-android-sdkmanager-packages-api-28-alpha-{{ checksum "scripts/.tests.env" }}
- &save-cache-android-packages
paths:
- /opt/android/sdk
key: v1-android-sdkmanager-packages-api-26-alpha-{{ checksum "scripts/.tests.env" }}
key: v1-android-sdkmanager-packages-api-28-alpha-{{ checksum "scripts/.tests.env" }}

- &restore-cache-gradle
keys:
Expand Down Expand Up @@ -354,7 +354,7 @@ js_defaults: &js_defaults
android_defaults: &android_defaults
<<: *defaults
docker:
- image: circleci/android:api-26-node8-alpha
- image: circleci/android:api-28-node8-alpha
resource_class: "large"
environment:
- TERM: "dumb"
Expand Down
4 changes: 2 additions & 2 deletions ContainerShip/Dockerfile.android-base
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ LABEL maintainer="Héctor Ramos <hector@fb.com>"

# set default build arguments
ARG SDK_VERSION=sdk-tools-linux-3859397.zip
ARG ANDROID_BUILD_VERSION=26
ARG ANDROID_TOOLS_VERSION=26.0.3
ARG ANDROID_BUILD_VERSION=28
ARG ANDROID_TOOLS_VERSION=28.0.2
ARG BUCK_VERSION=v2018.07.23.01
ARG NDK_VERSION=17b
ARG NODE_VERSION=8.10.0
Expand Down
10 changes: 5 additions & 5 deletions RNTester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = true

android {
compileSdkVersion 26
buildToolsVersion "26.0.3"
compileSdkVersion 28
buildToolsVersion "28.0.2"

defaultConfig {
applicationId "com.facebook.react.uiapp"
Expand Down Expand Up @@ -140,9 +140,9 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.1.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'

// Build React Native from source
compile project(':ReactAndroid')
implementation project(':ReactAndroid')
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;

import javax.annotation.Nullable;
import android.support.annotation.Nullable;

public class RNTesterActivity extends ReactActivity {
public static class RNTesterActivityDelegate extends ReactActivityDelegate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import java.util.Arrays;
import java.util.List;

import javax.annotation.Nullable;
import android.support.annotation.Nullable;

public class RNTesterApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
Expand Down
48 changes: 24 additions & 24 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ task packageReactNdkLibsForBuck(dependsOn: packageReactNdkLibs, type: Copy) {
}

android {
compileSdkVersion 26
buildToolsVersion "26.0.3"
compileSdkVersion 28
buildToolsVersion "28.0.2"

defaultConfig {
minSdkVersion 16
Expand Down Expand Up @@ -293,30 +293,30 @@ android {
}

dependencies {
compile fileTree(dir: 'src/main/third-party/java/infer-annotations/', include: ['*.jar'])
compile 'javax.inject:javax.inject:1'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.facebook.fbui.textlayoutbuilder:textlayoutbuilder:1.0.0'
compile 'com.facebook.fresco:fresco:1.10.0'
compile 'com.facebook.fresco:imagepipeline-okhttp3:1.9.0'
compile 'com.facebook.soloader:soloader:0.5.1'
compile 'com.google.code.findbugs:jsr305:3.0.2'
compile 'com.squareup.okhttp3:okhttp:3.10.0'
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.10.0'
compile 'com.squareup.okio:okio:1.14.0'
implementation fileTree(dir: 'src/main/third-party/java/infer-annotations/', include: ['*.jar'])
implementation 'javax.inject:javax.inject:1'
implementation 'com.android.support:appcompat-v7:27.1.1'
api 'com.facebook.fbui.textlayoutbuilder:textlayoutbuilder:1.0.0'
api 'com.facebook.fresco:fresco:1.10.0'
api 'com.facebook.fresco:imagepipeline-okhttp3:1.10.0'
api 'com.facebook.soloader:soloader:0.5.1'
api 'com.google.code.findbugs:jsr305:3.0.2'
api 'com.squareup.okhttp3:okhttp:3.10.0'
api 'com.squareup.okhttp3:okhttp-urlconnection:3.10.0'
api 'com.squareup.okio:okio:1.14.0'
compile 'org.webkit:android-jsc:r174650'

testCompile "junit:junit:${JUNIT_VERSION}"
testCompile "org.powermock:powermock-api-mockito:${POWERMOCK_VERSION}"
testCompile "org.powermock:powermock-module-junit4-rule:${POWERMOCK_VERSION}"
testCompile "org.powermock:powermock-classloading-xstream:${POWERMOCK_VERSION}"
testCompile "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"
testCompile "org.easytesting:fest-assert-core:${FEST_ASSERT_CORE_VERSION}"
testCompile "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}"

androidTestCompile fileTree(dir: 'src/main/third-party/java/buck-android-support/', include: ['*.jar'])
androidTestCompile 'com.android.support.test:runner:0.3'
androidTestCompile "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"
testImplementation "junit:junit:${JUNIT_VERSION}"
testImplementation "org.powermock:powermock-api-mockito:${POWERMOCK_VERSION}"
testImplementation "org.powermock:powermock-module-junit4-rule:${POWERMOCK_VERSION}"
testImplementation "org.powermock:powermock-classloading-xstream:${POWERMOCK_VERSION}"
testImplementation "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"
testImplementation "org.easytesting:fest-assert-core:${FEST_ASSERT_CORE_VERSION}"
testImplementation "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}"

androidTestImplementation fileTree(dir: 'src/main/third-party/java/buck-android-support/', include: ['*.jar'])
androidTestImplementation 'com.android.support.test:runner:0.3'
androidTestImplementation "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"
}

apply from: 'release.gradle'
1 change: 1 addition & 0 deletions ReactAndroid/src/main/java/com/facebook/react/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ rn_android_library(
react_native_dep("java/com/facebook/systrace:systrace"),
react_native_dep("libraries/fbcore/src/main/java/com/facebook/common/logging:logging"),
react_native_dep("libraries/soloader/java/com/facebook/soloader:soloader"),
react_native_dep("third-party/android/support-annotations:android-support-annotations"),
react_native_dep("third-party/java/infer-annotations:infer-annotations"),
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_target("java/com/facebook/debug/holder:holder"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ prebuilt_jar(

remote_file(
name = "support-annotations-binary.jar",
sha1 = "0814258103cf26a15fcc26ecce35f5b7d24b73f8",
url = "mvn:com.android.support:support-annotations:jar:26.1.0",
sha1 = "39ded76b5e1ce1c5b2688e1d25cdc20ecee32007",
url = "mvn:com.android.support:support-annotations:jar:27.1.1",
)
44 changes: 28 additions & 16 deletions ReactAndroid/src/main/third-party/android/support/v4/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ android_library(
":android-lifecycle-common",
":android-lifecycle-core",
":android-lifecycle-runtime",
":android-lifecycle-viewmodel",
":lib-support-v4-support-compat",
":lib-support-v4-support-core-ui",
":lib-support-v4-support-core-utils",
Expand All @@ -28,6 +29,11 @@ android_prebuilt_aar(
aar = ":android-lifecycle-runtime-aar",
)

android_prebuilt_aar(
name = "android-lifecycle-viewmodel",
aar = ":android-lifecycle-viewmodel-aar",
)

android_prebuilt_aar(
name = "lib-support-v4-support-compat",
aar = ":lib-support-v4-support-compat-aar",
Expand Down Expand Up @@ -55,48 +61,54 @@ android_prebuilt_aar(

remote_file(
name = "android-lifecycle-runtime-aar",
sha1 = "30c60a8a357ee1321ffd0c9f08ef54b24045cd10",
url = "mvn:android.arch.lifecycle:runtime:aar:1.0.0",
sha1 = "95428e5f6bf6875a6a1125d2157c3836a1a837f5",
url = "mvn:android.arch.lifecycle:runtime:aar:1.1.0",
)

remote_file(
name = "android-lifecycle-common.jar",
sha1 = "e414a4cb28434e25c4f6aa71426eb20cf4874ae9",
url = "mvn:android.arch.lifecycle:common:jar:1.0.0",
sha1 = "0edf3f7bfb84a7521d0599efa3b0113a0ee90f85",
url = "mvn:android.arch.lifecycle:common:jar:1.1.0",
)

remote_file(
name = "android-lifecycle-core.jar",
sha1 = "a2d487452376193fc8c103dd2b9bd5f2b1b44563",
url = "mvn:android.arch.core:common:jar:1.0.0",
sha1 = "8007981f7d7540d89cd18471b8e5dcd2b4f99167",
url = "mvn:android.arch.core:common:jar:1.1.0",
)

remote_file(
name = "android-lifecycle-viewmodel-aar",
sha1 = "74ee369b874da61b5b81bebd7b8df0c2577309c8",
url = "mvn:android.arch.lifecycle:viewmodel:aar:1.1.0",
)

remote_file(
name = "lib-support-v4-support-compat-aar",
sha1 = "1e1c8ffc01d277d8f01dfd11d5d2ce3a2af4b98c",
url = "mvn:com.android.support:support-compat:aar:26.1.0",
sha1 = "a55ad550d0b84c7fec7ecca012690636062c0e64",
url = "mvn:com.android.support:support-compat:aar:27.1.1",
)

remote_file(
name = "lib-support-v4-support-core-utils-aar",
sha1 = "1bfaae21c4d5c5532c5e732071e9ce234cd58cff",
url = "mvn:com.android.support:support-core-utils:aar:26.1.0",
sha1 = "b3a7a4040fda0c5138dbc8c477103b6723b9dbe6",
url = "mvn:com.android.support:support-core-utils:aar:27.1.1",
)

remote_file(
name = "lib-support-v4-support-core-ui-aar",
sha1 = "e306308d54052a1ded7bf9c2f5c2fdf5152a1f22",
url = "mvn:com.android.support:support-core-ui:aar:26.1.0",
sha1 = "f9acdb8a4c3a9fe883fd7fa5efd3f0426bb9dcda",
url = "mvn:com.android.support:support-core-ui:aar:27.1.1",
)

remote_file(
name = "lib-support-v4-support-media-compat-aar",
sha1 = "09fb587f27cde19aa8f2e50c5c9ee645d9aec44d",
url = "mvn:com.android.support:support-media-compat:aar:26.1.0",
sha1 = "10e309e2cc22ff4cab30bd5f573e4bb30be707ad",
url = "mvn:com.android.support:support-media-compat:aar:27.1.1",
)

remote_file(
name = "lib-support-v4-support-fragment-aar",
sha1 = "ddacf369bb98dd6558606558de8ddcd53895cf91",
url = "mvn:com.android.support:support-fragment:aar:26.1.0",
sha1 = "eb8053ebf038b7561c29e5e8964664fac05f375e",
url = "mvn:com.android.support:support-fragment:aar:27.1.1",
)
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ python_binary(

remote_file(
name = "appcompat-binary-aar",
sha1 = "da5771a9ac6e8f3a461360eed3c6f921dc7580fd",
url = "mvn:com.android.support:appcompat-v7:aar:26.1.0",
sha1 = "22b1ef4ff9ef1a3513c18eb132d597eac6ef1a86",
url = "mvn:com.android.support:appcompat-v7:aar:27.1.1",
)
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
environment:
ANDROID_HOME: "C:\\android-sdk-windows"
ANDROID_NDK: "C:\\android-sdk-windows\\android-ndk-r17b"
ANDROID_BUILD_VERSION: 26
ANDROID_TOOLS_VERSION: 26.0.3
ANDROID_BUILD_VERSION: 28
ANDROID_TOOLS_VERSION: 28.0.2

GRADLE_OPTS: -Dorg.gradle.daemon=false

Expand Down
12 changes: 3 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ buildscript {
repositories {
jcenter()
mavenLocal()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'de.undercouch:gradle-download-task:3.4.3'

// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -25,10 +22,7 @@ allprojects {
repositories {
jcenter()
mavenLocal()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()

def androidSdk = System.getenv("ANDROID_SDK")
maven {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
6 changes: 3 additions & 3 deletions local-cli/link/__fixtures__/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:26.1.0"
compile "com.facebook.react:react-native:+"
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:27.1.1"
implementation "com.facebook.react:react-native:+"
}
10 changes: 5 additions & 5 deletions local-cli/link/__fixtures__/android/patchedBuild.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies {
compile project(':test')
compile(project(':test2')) {
implementation project(':test')
implementation(project(':test2')) {
exclude(group: 'org.unwanted', module: 'test10')
}
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:26.1.0"
compile "com.facebook.react:react-native:+"
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:27.1.1"
implementation "com.facebook.react:react-native:+"
}
8 changes: 4 additions & 4 deletions local-cli/link/__tests__/android/makeBuildPatch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,25 @@ describe('makeBuildPatch', () => {

it('should make a correct patch', () => {
const {patch} = makeBuildPatch(name);
expect(patch).toBe(` compile project(':${name}')\n`);
expect(patch).toBe(` implementation project(':${name}')\n`);
});

it('should make a correct install check pattern', () => {
const {installPattern} = makeBuildPatch(name);
const match = `/\\s{4}(compile)(\\(|\\s)(project)\\(\\':${name}\\'\\)(\\)|\\s)/`;
const match = `/\\s{4}(implementation)(\\(|\\s)(project)\\(\\':${name}\\'\\)(\\)|\\s)/`;
expect(installPattern.toString()).toBe(match);
});
});

describe('makeBuildPatchWithScopedPackage', () => {
it('should make a correct patch', () => {
const {patch} = makeBuildPatch(scopedName);
expect(patch).toBe(` compile project(':${normalizedScopedName}')\n`);
expect(patch).toBe(` implementation project(':${normalizedScopedName}')\n`);
});

it('should make a correct install check pattern', () => {
const {installPattern} = makeBuildPatch(scopedName);
const match = `/\\s{4}(compile)(\\(|\\s)(project)\\(\\':${normalizedScopedName}\\'\\)(\\)|\\s)/`;
const match = `/\\s{4}(implementation)(\\(|\\s)(project)\\(\\':${normalizedScopedName}\\'\\)(\\)|\\s)/`;
expect(installPattern.toString()).toBe(match);
});
});
4 changes: 2 additions & 2 deletions local-cli/link/android/patches/makeBuildPatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ const normalizeProjectName = require('./normalizeProjectName');
module.exports = function makeBuildPatch(name) {
const normalizedProjectName = normalizeProjectName(name);
const installPattern = new RegExp(
`\\s{4}(compile)(\\(|\\s)(project)\\(\\\':${normalizedProjectName}\\\'\\)(\\)|\\s)`,
`\\s{4}(implementation)(\\(|\\s)(project)\\(\\\':${normalizedProjectName}\\\'\\)(\\)|\\s)`,
);

return {
installPattern,
pattern: /[^ \t]dependencies {(\r\n|\n)/,
patch: ` compile project(':${normalizedProjectName}')\n`,
patch: ` implementation project(':${normalizedProjectName}')\n`,
};
};
6 changes: 3 additions & 3 deletions local-cli/templates/HelloWorld/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ android {
}

dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
compile "com.facebook.react:react-native:+" // From node_modules
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
}

// Run this once to be able to run the application with BUCK
Expand Down
Loading