diff --git a/local-cli/link/__fixtures__/android/build.gradle b/local-cli/link/__fixtures__/android/build.gradle index 70785a4faac7c8..4dd26f8e088024 100644 --- a/local-cli/link/__fixtures__/android/build.gradle +++ b/local-cli/link/__fixtures__/android/build.gradle @@ -1,5 +1,5 @@ dependencies { - compile fileTree(dir: "libs", include: ["*.jar"]) - compile "com.android.support:appcompat-v7:27.1.1" - 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:+" } diff --git a/local-cli/link/__fixtures__/android/patchedBuild.gradle b/local-cli/link/__fixtures__/android/patchedBuild.gradle index 8cade796a256f3..425aaaf7f44427 100644 --- a/local-cli/link/__fixtures__/android/patchedBuild.gradle +++ b/local-cli/link/__fixtures__/android/patchedBuild.gradle @@ -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:27.1.1" - 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:+" } diff --git a/local-cli/link/__tests__/android/makeBuildPatch.spec.js b/local-cli/link/__tests__/android/makeBuildPatch.spec.js index 51873daf1d0236..4329f1f157facc 100644 --- a/local-cli/link/__tests__/android/makeBuildPatch.spec.js +++ b/local-cli/link/__tests__/android/makeBuildPatch.spec.js @@ -26,12 +26,12 @@ 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); }); }); @@ -39,12 +39,14 @@ describe('makeBuildPatch', () => { 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); }); }); diff --git a/local-cli/link/android/patches/makeBuildPatch.js b/local-cli/link/android/patches/makeBuildPatch.js index dfaab8f6998bfe..246f3358540df6 100644 --- a/local-cli/link/android/patches/makeBuildPatch.js +++ b/local-cli/link/android/patches/makeBuildPatch.js @@ -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`, }; };