diff --git a/templates/android.js b/templates/android.js index 713ce20b..0889027a 100644 --- a/templates/android.js +++ b/templates/android.js @@ -1,54 +1,20 @@ module.exports = platform => [{ name: () => `${platform}/build.gradle`, - content: ({ packageIdentifier }) => `// ${platform}/build.gradle + content: () => `// ${platform}/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName "1.0" } @@ -75,79 +41,6 @@ dependencies { //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules } - -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = "${packageIdentifier}" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task "jar\${name}"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: "file://\${projectDir}/../android/maven" - configureReactNativePom pom - } - } -} `, }, { name: () => `${platform}/src/main/AndroidManifest.xml`, @@ -285,21 +178,4 @@ public class ${objectClassName}Package implements ReactPackage { } } `, -}, { - name: () => `${platform}/README.md`, - content: () => `README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number -` }]; diff --git a/tests/integration/cli/create/view/__snapshots__/cli-create-with-view.test.js.snap b/tests/integration/cli/create/view/__snapshots__/cli-create-with-view.test.js.snap index 31ebf6a1..73fa7a07 100644 --- a/tests/integration/cli/create/view/__snapshots__/cli-create-with-view.test.js.snap +++ b/tests/integration/cli/create/view/__snapshots__/cli-create-with-view.test.js.snap @@ -67,77 +67,25 @@ import IntegrationViewTestPackage from 'react-native-integration-view-test-packa // TODO: What to do with the module? IntegrationViewTestPackage; \`\`\` -", - }, - Object { - "name": "react-native-integration-view-test-package/android/README.md", - "theContent": "README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number ", }, Object { "name": "react-native-integration-view-test-package/android/build.gradle", "theContent": "// android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -164,79 +112,6 @@ dependencies { //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules } - -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} ", }, Object { diff --git a/tests/integration/cli/create/with-defaults/__snapshots__/cli-create-with-defaults.test.js.snap b/tests/integration/cli/create/with-defaults/__snapshots__/cli-create-with-defaults.test.js.snap index 5fb6f720..762aabed 100644 --- a/tests/integration/cli/create/with-defaults/__snapshots__/cli-create-with-defaults.test.js.snap +++ b/tests/integration/cli/create/with-defaults/__snapshots__/cli-create-with-defaults.test.js.snap @@ -67,77 +67,25 @@ import IntegrationTestPackage from 'react-native-integration-test-package'; // TODO: What to do with the module? IntegrationTestPackage; \`\`\` -", - }, - Object { - "name": "react-native-integration-test-package/android/README.md", - "theContent": "README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number ", }, Object { "name": "react-native-integration-test-package/android/build.gradle", "theContent": "// android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -164,79 +112,6 @@ dependencies { //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules } - -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} ", }, Object { diff --git a/tests/with-injection/create/view/with-defaults/__snapshots__/create-view-with-defaults.test.js.snap b/tests/with-injection/create/view/with-defaults/__snapshots__/create-view-with-defaults.test.js.snap index 6f8e5175..a765cadf 100644 --- a/tests/with-injection/create/view/with-defaults/__snapshots__/create-view-with-defaults.test.js.snap +++ b/tests/with-injection/create/view/with-defaults/__snapshots__/create-view-with-defaults.test.js.snap @@ -19,8 +19,6 @@ Array [ "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ ", "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ -", - "* ensureDir dir: react-native-alice-bobbi/android/ ", "* ensureDir dir: react-native-alice-bobbi/ ", @@ -165,53 +163,19 @@ content: -------- // android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -239,79 +203,6 @@ dependencies { implementation 'com.facebook.react:react-native:+' // From node_modules } -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/android/src/main/AndroidManifest.xml @@ -382,26 +273,6 @@ public class AliceBobbiPackage implements ReactPackage { } } -<<<<<<<< ======== >>>>>>>> -", - "* outputFile name: react-native-alice-bobbi/android/README.md -content: --------- -README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/react-native-alice-bobbi.podspec diff --git a/tests/with-injection/create/view/with-example/with-defaults/__snapshots__/create-view-with-example-with-defaults.test.js.snap b/tests/with-injection/create/view/with-example/with-defaults/__snapshots__/create-view-with-example-with-defaults.test.js.snap index bc87a38b..f3201a17 100644 --- a/tests/with-injection/create/view/with-example/with-defaults/__snapshots__/create-view-with-example-with-defaults.test.js.snap +++ b/tests/with-injection/create/view/with-example/with-defaults/__snapshots__/create-view-with-example-with-defaults.test.js.snap @@ -23,8 +23,6 @@ Array [ "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ ", "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ -", - "* ensureDir dir: react-native-alice-bobbi/android/ ", "* ensureDir dir: react-native-alice-bobbi/ ", @@ -169,53 +167,19 @@ content: -------- // android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -243,79 +207,6 @@ dependencies { implementation 'com.facebook.react:react-native:+' // From node_modules } -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/android/src/main/AndroidManifest.xml @@ -386,26 +277,6 @@ public class AliceBobbiPackage implements ReactPackage { } } -<<<<<<<< ======== >>>>>>>> -", - "* outputFile name: react-native-alice-bobbi/android/README.md -content: --------- -README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/react-native-alice-bobbi.podspec diff --git a/tests/with-injection/create/view/with-example/with-options/__snapshots__/create-view-with-example-with-options.test.js.snap b/tests/with-injection/create/view/with-example/with-options/__snapshots__/create-view-with-example-with-options.test.js.snap index c62a2ebb..c58b4308 100644 --- a/tests/with-injection/create/view/with-example/with-options/__snapshots__/create-view-with-example-with-options.test.js.snap +++ b/tests/with-injection/create/view/with-example/with-options/__snapshots__/create-view-with-example-with-options.test.js.snap @@ -23,8 +23,6 @@ Array [ "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ ", "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ -", - "* ensureDir dir: react-native-alice-bobbi/android/ ", "* ensureDir dir: react-native-alice-bobbi/ ", @@ -169,53 +167,19 @@ content: -------- // android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -243,79 +207,6 @@ dependencies { implementation 'com.facebook.react:react-native:+' // From node_modules } -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/android/src/main/AndroidManifest.xml @@ -386,26 +277,6 @@ public class AliceBobbiPackage implements ReactPackage { } } -<<<<<<<< ======== >>>>>>>> -", - "* outputFile name: react-native-alice-bobbi/android/README.md -content: --------- -README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/react-native-alice-bobbi.podspec diff --git a/tests/with-injection/create/view/with-options/for-android/__snapshots__/lib-view-android-config-options.test.js.snap b/tests/with-injection/create/view/with-options/for-android/__snapshots__/lib-view-android-config-options.test.js.snap index 89d8b2de..6e27ab9b 100644 --- a/tests/with-injection/create/view/with-options/for-android/__snapshots__/lib-view-android-config-options.test.js.snap +++ b/tests/with-injection/create/view/with-options/for-android/__snapshots__/lib-view-android-config-options.test.js.snap @@ -19,8 +19,6 @@ Array [ "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ ", "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ -", - "* ensureDir dir: react-native-alice-bobbi/android/ ", "* outputFile name: react-native-alice-bobbi/README.md content: @@ -133,53 +131,19 @@ content: -------- // android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -207,79 +171,6 @@ dependencies { implementation 'com.facebook.react:react-native:+' // From node_modules } -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/android/src/main/AndroidManifest.xml @@ -350,26 +241,6 @@ public class AliceBobbiPackage implements ReactPackage { } } -<<<<<<<< ======== >>>>>>>> -", - "* outputFile name: react-native-alice-bobbi/android/README.md -content: --------- -README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number - <<<<<<<< ======== >>>>>>>> ", ] diff --git a/tests/with-injection/create/with-defaults/__snapshots__/create-with-defaults.test.js.snap b/tests/with-injection/create/with-defaults/__snapshots__/create-with-defaults.test.js.snap index 072d59fa..a3139695 100644 --- a/tests/with-injection/create/with-defaults/__snapshots__/create-with-defaults.test.js.snap +++ b/tests/with-injection/create/with-defaults/__snapshots__/create-with-defaults.test.js.snap @@ -19,8 +19,6 @@ Array [ "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ ", "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ -", - "* ensureDir dir: react-native-alice-bobbi/android/ ", "* ensureDir dir: react-native-alice-bobbi/ ", @@ -165,53 +163,19 @@ content: -------- // android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -239,79 +203,6 @@ dependencies { implementation 'com.facebook.react:react-native:+' // From node_modules } -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/android/src/main/AndroidManifest.xml @@ -383,26 +274,6 @@ public class AliceBobbiPackage implements ReactPackage { } } -<<<<<<<< ======== >>>>>>>> -", - "* outputFile name: react-native-alice-bobbi/android/README.md -content: --------- -README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/react-native-alice-bobbi.podspec diff --git a/tests/with-injection/create/with-example/for-android-only/__snapshots__/create-with-example-for-android-only.test.js.snap b/tests/with-injection/create/with-example/for-android-only/__snapshots__/create-with-example-for-android-only.test.js.snap index a2b3b77f..96475610 100644 --- a/tests/with-injection/create/with-example/for-android-only/__snapshots__/create-with-example-for-android-only.test.js.snap +++ b/tests/with-injection/create/with-example/for-android-only/__snapshots__/create-with-example-for-android-only.test.js.snap @@ -23,8 +23,6 @@ Array [ "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ ", "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ -", - "* ensureDir dir: react-native-alice-bobbi/android/ ", "* outputFile name: react-native-alice-bobbi/README.md content: @@ -137,53 +135,19 @@ content: -------- // android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -211,79 +175,6 @@ dependencies { implementation 'com.facebook.react:react-native:+' // From node_modules } -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/android/src/main/AndroidManifest.xml @@ -355,26 +246,6 @@ public class AliceBobbiPackage implements ReactPackage { } } -<<<<<<<< ======== >>>>>>>> -", - "* outputFile name: react-native-alice-bobbi/android/README.md -content: --------- -README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number - <<<<<<<< ======== >>>>>>>> ", "* execa.commandSync command: react-native init example --version react-native@latest options: {\\"cwd\\":\\"./react-native-alice-bobbi\\",\\"stdio\\":\\"inherit\\"} diff --git a/tests/with-injection/create/with-example/with-defaults/__snapshots__/create-with-example-with-defaults.test.js.snap b/tests/with-injection/create/with-example/with-defaults/__snapshots__/create-with-example-with-defaults.test.js.snap index 548ff6c1..a3dd904e 100644 --- a/tests/with-injection/create/with-example/with-defaults/__snapshots__/create-with-example-with-defaults.test.js.snap +++ b/tests/with-injection/create/with-example/with-defaults/__snapshots__/create-with-example-with-defaults.test.js.snap @@ -23,8 +23,6 @@ Array [ "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ ", "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ -", - "* ensureDir dir: react-native-alice-bobbi/android/ ", "* ensureDir dir: react-native-alice-bobbi/ ", @@ -169,53 +167,19 @@ content: -------- // android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -243,79 +207,6 @@ dependencies { implementation 'com.facebook.react:react-native:+' // From node_modules } -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/android/src/main/AndroidManifest.xml @@ -387,26 +278,6 @@ public class AliceBobbiPackage implements ReactPackage { } } -<<<<<<<< ======== >>>>>>>> -", - "* outputFile name: react-native-alice-bobbi/android/README.md -content: --------- -README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/react-native-alice-bobbi.podspec diff --git a/tests/with-injection/create/with-example/with-missing-package-scripts/__snapshots__/recover-from-missing-package-scripts.test.js.snap b/tests/with-injection/create/with-example/with-missing-package-scripts/__snapshots__/recover-from-missing-package-scripts.test.js.snap index 891b3c9d..91daae34 100644 --- a/tests/with-injection/create/with-example/with-missing-package-scripts/__snapshots__/recover-from-missing-package-scripts.test.js.snap +++ b/tests/with-injection/create/with-example/with-missing-package-scripts/__snapshots__/recover-from-missing-package-scripts.test.js.snap @@ -23,8 +23,6 @@ Array [ "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ ", "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ -", - "* ensureDir dir: react-native-alice-bobbi/android/ ", "* ensureDir dir: react-native-alice-bobbi/ ", @@ -169,53 +167,19 @@ content: -------- // android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -243,79 +207,6 @@ dependencies { implementation 'com.facebook.react:react-native:+' // From node_modules } -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/android/src/main/AndroidManifest.xml @@ -387,26 +278,6 @@ public class AliceBobbiPackage implements ReactPackage { } } -<<<<<<<< ======== >>>>>>>> -", - "* outputFile name: react-native-alice-bobbi/android/README.md -content: --------- -README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/react-native-alice-bobbi.podspec diff --git a/tests/with-injection/create/with-example/with-null-options/with-null-prefix/__snapshots__/create-with-example-with-null-prefix.test.js.snap b/tests/with-injection/create/with-example/with-null-options/with-null-prefix/__snapshots__/create-with-example-with-null-prefix.test.js.snap index a3eddcbd..fb3797ca 100644 --- a/tests/with-injection/create/with-example/with-null-options/with-null-prefix/__snapshots__/create-with-example-with-null-prefix.test.js.snap +++ b/tests/with-injection/create/with-example/with-null-options/with-null-prefix/__snapshots__/create-with-example-with-null-prefix.test.js.snap @@ -23,8 +23,6 @@ Array [ "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ ", "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ -", - "* ensureDir dir: react-native-alice-bobbi/android/ ", "* ensureDir dir: react-native-alice-bobbi/ ", @@ -169,53 +167,19 @@ content: -------- // android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -243,79 +207,6 @@ dependencies { implementation 'com.facebook.react:react-native:+' // From node_modules } -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/android/src/main/AndroidManifest.xml @@ -387,26 +278,6 @@ public class AliceBobbiPackage implements ReactPackage { } } -<<<<<<<< ======== >>>>>>>> -", - "* outputFile name: react-native-alice-bobbi/android/README.md -content: --------- -README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/react-native-alice-bobbi.podspec diff --git a/tests/with-injection/create/with-example/with-options/__snapshots__/create-with-example-with-options.test.js.snap b/tests/with-injection/create/with-example/with-options/__snapshots__/create-with-example-with-options.test.js.snap index ffaf3d06..68633045 100644 --- a/tests/with-injection/create/with-example/with-options/__snapshots__/create-with-example-with-options.test.js.snap +++ b/tests/with-injection/create/with-example/with-options/__snapshots__/create-with-example-with-options.test.js.snap @@ -23,8 +23,6 @@ Array [ "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ ", "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ -", - "* ensureDir dir: react-native-alice-bobbi/android/ ", "* ensureDir dir: react-native-alice-bobbi/ ", @@ -169,53 +167,19 @@ content: -------- // android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -243,79 +207,6 @@ dependencies { implementation 'com.facebook.react:react-native:+' // From node_modules } -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/android/src/main/AndroidManifest.xml @@ -387,26 +278,6 @@ public class SuperAwesomeModulePackage implements ReactPackage { } } -<<<<<<<< ======== >>>>>>>> -", - "* outputFile name: react-native-alice-bobbi/android/README.md -content: --------- -README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/react-native-alice-bobbi.podspec diff --git a/tests/with-injection/create/with-name-in-camel-case/__snapshots__/create-with-name-in-camel-case.test.js.snap b/tests/with-injection/create/with-name-in-camel-case/__snapshots__/create-with-name-in-camel-case.test.js.snap index ed714e3c..17e83e2f 100644 --- a/tests/with-injection/create/with-name-in-camel-case/__snapshots__/create-with-name-in-camel-case.test.js.snap +++ b/tests/with-injection/create/with-name-in-camel-case/__snapshots__/create-with-name-in-camel-case.test.js.snap @@ -19,8 +19,6 @@ Array [ "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ ", "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ -", - "* ensureDir dir: react-native-alice-bobbi/android/ ", "* ensureDir dir: react-native-alice-bobbi/ ", @@ -165,53 +163,19 @@ content: -------- // android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -239,79 +203,6 @@ dependencies { implementation 'com.facebook.react:react-native:+' // From node_modules } -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/android/src/main/AndroidManifest.xml @@ -383,26 +274,6 @@ public class AliceBobbiPackage implements ReactPackage { } } -<<<<<<<< ======== >>>>>>>> -", - "* outputFile name: react-native-alice-bobbi/android/README.md -content: --------- -README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/react-native-alice-bobbi.podspec diff --git a/tests/with-injection/create/with-options/for-android/__snapshots__/create-with-options-for-android.test.js.snap b/tests/with-injection/create/with-options/for-android/__snapshots__/create-with-options-for-android.test.js.snap index 2381e0d9..cab8a2e0 100644 --- a/tests/with-injection/create/with-options/for-android/__snapshots__/create-with-options-for-android.test.js.snap +++ b/tests/with-injection/create/with-options/for-android/__snapshots__/create-with-options-for-android.test.js.snap @@ -19,8 +19,6 @@ Array [ "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/alicebits/ ", "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/alicebits/ -", - "* ensureDir dir: react-native-alice-bobbi/android/ ", "* outputFile name: react-native-alice-bobbi/README.md content: @@ -133,53 +131,19 @@ content: -------- // android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -207,79 +171,6 @@ dependencies { implementation 'com.facebook.react:react-native:+' // From node_modules } -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.alicebits\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/android/src/main/AndroidManifest.xml @@ -351,26 +242,6 @@ public class AliceBobbiPackage implements ReactPackage { } } -<<<<<<<< ======== >>>>>>>> -", - "* outputFile name: react-native-alice-bobbi/android/README.md -content: --------- -README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number - <<<<<<<< ======== >>>>>>>> ", ] diff --git a/tests/with-injection/create/with-options/platforms-array/__snapshots__/platforms-array.test.js.snap b/tests/with-injection/create/with-options/platforms-array/__snapshots__/platforms-array.test.js.snap index ddb98d0f..22d5707f 100644 --- a/tests/with-injection/create/with-options/platforms-array/__snapshots__/platforms-array.test.js.snap +++ b/tests/with-injection/create/with-options/platforms-array/__snapshots__/platforms-array.test.js.snap @@ -19,8 +19,6 @@ Array [ "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ ", "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ -", - "* ensureDir dir: react-native-alice-bobbi/android/ ", "* ensureDir dir: react-native-alice-bobbi/ ", @@ -165,53 +163,19 @@ content: -------- // android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -239,79 +203,6 @@ dependencies { implementation 'com.facebook.react:react-native:+' // From node_modules } -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/android/src/main/AndroidManifest.xml @@ -383,26 +274,6 @@ public class ABCAliceBobbiPackage implements ReactPackage { } } -<<<<<<<< ======== >>>>>>>> -", - "* outputFile name: react-native-alice-bobbi/android/README.md -content: --------- -README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/react-native-alice-bobbi.podspec diff --git a/tests/with-injection/create/with-options/platforms-comma-separated/__snapshots__/platforms-comma-separated.test.js.snap b/tests/with-injection/create/with-options/platforms-comma-separated/__snapshots__/platforms-comma-separated.test.js.snap index 19f6f82b..d80ba3cf 100644 --- a/tests/with-injection/create/with-options/platforms-comma-separated/__snapshots__/platforms-comma-separated.test.js.snap +++ b/tests/with-injection/create/with-options/platforms-comma-separated/__snapshots__/platforms-comma-separated.test.js.snap @@ -19,8 +19,6 @@ Array [ "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ ", "* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ -", - "* ensureDir dir: react-native-alice-bobbi/android/ ", "* ensureDir dir: react-native-alice-bobbi/ ", @@ -165,53 +163,19 @@ content: -------- // android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -239,79 +203,6 @@ dependencies { implementation 'com.facebook.react:react-native:+' // From node_modules } -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/android/src/main/AndroidManifest.xml @@ -383,26 +274,6 @@ public class AliceBobbiPackage implements ReactPackage { } } -<<<<<<<< ======== >>>>>>>> -", - "* outputFile name: react-native-alice-bobbi/android/README.md -content: --------- -README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: react-native-alice-bobbi/react-native-alice-bobbi.podspec diff --git a/tests/with-injection/create/with-options/with-custom-module-prefix/__snapshots__/create-with-custom-module-prefix.test.js.snap b/tests/with-injection/create/with-options/with-custom-module-prefix/__snapshots__/create-with-custom-module-prefix.test.js.snap index e5158e75..29a0d3f5 100644 --- a/tests/with-injection/create/with-options/with-custom-module-prefix/__snapshots__/create-with-custom-module-prefix.test.js.snap +++ b/tests/with-injection/create/with-options/with-custom-module-prefix/__snapshots__/create-with-custom-module-prefix.test.js.snap @@ -19,8 +19,6 @@ Array [ "* ensureDir dir: custom-native-alice-bobbi/android/src/main/java/com/reactlibrary/ ", "* ensureDir dir: custom-native-alice-bobbi/android/src/main/java/com/reactlibrary/ -", - "* ensureDir dir: custom-native-alice-bobbi/android/ ", "* ensureDir dir: custom-native-alice-bobbi/ ", @@ -165,53 +163,19 @@ content: -------- // android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -239,79 +203,6 @@ dependencies { implementation 'com.facebook.react:react-native:+' // From node_modules } -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: custom-native-alice-bobbi/android/src/main/AndroidManifest.xml @@ -383,26 +274,6 @@ public class AliceBobbiPackage implements ReactPackage { } } -<<<<<<<< ======== >>>>>>>> -", - "* outputFile name: custom-native-alice-bobbi/android/README.md -content: --------- -README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: custom-native-alice-bobbi/custom-native-alice-bobbi.podspec diff --git a/tests/with-injection/create/with-options/with-module-name/__snapshots__/create-with-module-name.test.js.snap b/tests/with-injection/create/with-options/with-module-name/__snapshots__/create-with-module-name.test.js.snap index 7c71eabb..693a0667 100644 --- a/tests/with-injection/create/with-options/with-module-name/__snapshots__/create-with-module-name.test.js.snap +++ b/tests/with-injection/create/with-options/with-module-name/__snapshots__/create-with-module-name.test.js.snap @@ -19,8 +19,6 @@ Array [ "* ensureDir dir: custom-native-module/android/src/main/java/com/reactlibrary/ ", "* ensureDir dir: custom-native-module/android/src/main/java/com/reactlibrary/ -", - "* ensureDir dir: custom-native-module/android/ ", "* ensureDir dir: custom-native-module/ ", @@ -165,53 +163,19 @@ content: -------- // android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -239,79 +203,6 @@ dependencies { implementation 'com.facebook.react:react-native:+' // From node_modules } -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: custom-native-module/android/src/main/AndroidManifest.xml @@ -383,26 +274,6 @@ public class AliceBobbiPackage implements ReactPackage { } } -<<<<<<<< ======== >>>>>>>> -", - "* outputFile name: custom-native-module/android/README.md -content: --------- -README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number - <<<<<<<< ======== >>>>>>>> ", "* outputFile name: custom-native-module/custom-native-module.podspec diff --git a/tests/with-mocks/cli/command/action-func/with-options/__snapshots__/cli-command-func-with-options.test.js.snap b/tests/with-mocks/cli/command/action-func/with-options/__snapshots__/cli-command-func-with-options.test.js.snap index 1df4b218..a0a2d3cb 100644 --- a/tests/with-mocks/cli/command/action-func/with-options/__snapshots__/cli-command-func-with-options.test.js.snap +++ b/tests/with-mocks/cli/command/action-func/with-options/__snapshots__/cli-command-func-with-options.test.js.snap @@ -29,9 +29,6 @@ Array [ Object { "ensureDir": "react-native-alice-bobbi/android/src/main/java/com/reactlibrary/", }, - Object { - "ensureDir": "react-native-alice-bobbi/android/", - }, Object { "ensureDir": "react-native-alice-bobbi/", }, @@ -171,53 +168,19 @@ buck-out/ "outputFileName": "react-native-alice-bobbi/android/build.gradle", "theContent": "// android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -244,79 +207,6 @@ dependencies { //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules } - -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} ", }, Object { @@ -382,24 +272,6 @@ public class AliceBobbiPackage implements ReactPackage { return Collections.emptyList(); } } -", - }, - Object { - "outputFileName": "react-native-alice-bobbi/android/README.md", - "theContent": "README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number ", }, Object { diff --git a/tests/with-mocks/cli/program/with-defaults/for-android/__snapshots__/cli-program-with-defaults-for-android.test.js.snap b/tests/with-mocks/cli/program/with-defaults/for-android/__snapshots__/cli-program-with-defaults-for-android.test.js.snap index bf00ba6e..ff066046 100644 --- a/tests/with-mocks/cli/program/with-defaults/for-android/__snapshots__/cli-program-with-defaults-for-android.test.js.snap +++ b/tests/with-mocks/cli/program/with-defaults/for-android/__snapshots__/cli-program-with-defaults-for-android.test.js.snap @@ -243,9 +243,6 @@ Array [ Object { "ensureDir": "react-native-test-package/android/src/main/java/com/reactlibrary/", }, - Object { - "ensureDir": "react-native-test-package/android/", - }, Object { "outputFileName": "react-native-test-package/README.md", "theContent": "# react-native-test-package @@ -348,53 +345,19 @@ buck-out/ "outputFileName": "react-native-test-package/android/build.gradle", "theContent": "// android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -421,79 +384,6 @@ dependencies { //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules } - -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} ", }, Object { @@ -559,24 +449,6 @@ public class TestPackagePackage implements ReactPackage { return Collections.emptyList(); } } -", - }, - Object { - "outputFileName": "react-native-test-package/android/README.md", - "theContent": "README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number ", }, ] diff --git a/tests/with-mocks/cli/program/with-example/with-logging/__snapshots__/cli-program-with-example-with-logging.test.js.snap b/tests/with-mocks/cli/program/with-example/with-logging/__snapshots__/cli-program-with-example-with-logging.test.js.snap index 579dff04..92e96a2c 100644 --- a/tests/with-mocks/cli/program/with-example/with-logging/__snapshots__/cli-program-with-example-with-logging.test.js.snap +++ b/tests/with-mocks/cli/program/with-example/with-logging/__snapshots__/cli-program-with-example-with-logging.test.js.snap @@ -314,9 +314,6 @@ exampleReactNativeVersion: react-native@latest Object { "ensureDir": "react-native-test-package/android/src/main/java/com/reactlibrary/", }, - Object { - "ensureDir": "react-native-test-package/android/", - }, Object { "ensureDir": "react-native-test-package/", }, @@ -456,53 +453,19 @@ buck-out/ "outputFileName": "react-native-test-package/android/build.gradle", "theContent": "// android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -529,79 +492,6 @@ dependencies { //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules } - -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} ", }, Object { @@ -667,24 +557,6 @@ public class TestPackagePackage implements ReactPackage { return Collections.emptyList(); } } -", - }, - Object { - "outputFileName": "react-native-test-package/android/README.md", - "theContent": "README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number ", }, Object { diff --git a/tests/with-mocks/lib/create/with-example/with-logging/with-defaults/__snapshots__/create-with-example-with-defaults.test.js.snap b/tests/with-mocks/lib/create/with-example/with-logging/with-defaults/__snapshots__/create-with-example-with-defaults.test.js.snap index caf50939..5d7861cc 100644 --- a/tests/with-mocks/lib/create/with-example/with-logging/with-defaults/__snapshots__/create-with-example-with-defaults.test.js.snap +++ b/tests/with-mocks/lib/create/with-example/with-logging/with-defaults/__snapshots__/create-with-example-with-defaults.test.js.snap @@ -100,9 +100,6 @@ exampleReactNativeVersion: react-native@latest Object { "ensureDir": "react-native-alice-bobbi/android/src/main/java/com/reactlibrary/", }, - Object { - "ensureDir": "react-native-alice-bobbi/android/", - }, Object { "ensureDir": "react-native-alice-bobbi/", }, @@ -242,53 +239,19 @@ buck-out/ "outputFileName": "react-native-alice-bobbi/android/build.gradle", "theContent": "// android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -315,79 +278,6 @@ dependencies { //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules } - -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} ", }, Object { @@ -453,24 +343,6 @@ public class AliceBobbiPackage implements ReactPackage { return Collections.emptyList(); } } -", - }, - Object { - "outputFileName": "react-native-alice-bobbi/android/README.md", - "theContent": "README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number ", }, Object { diff --git a/tests/with-mocks/lib/create/with-example/with-logging/with-error/__snapshots__/with-yarn-error-logging.test.js.snap b/tests/with-mocks/lib/create/with-example/with-logging/with-error/__snapshots__/with-yarn-error-logging.test.js.snap index f7e7a7a5..1d636500 100644 --- a/tests/with-mocks/lib/create/with-example/with-logging/with-error/__snapshots__/with-yarn-error-logging.test.js.snap +++ b/tests/with-mocks/lib/create/with-example/with-logging/with-error/__snapshots__/with-yarn-error-logging.test.js.snap @@ -100,9 +100,6 @@ exampleReactNativeVersion: react-native@latest Object { "ensureDir": "react-native-alice-bobbi/android/src/main/java/com/reactlibrary/", }, - Object { - "ensureDir": "react-native-alice-bobbi/android/", - }, Object { "ensureDir": "react-native-alice-bobbi/", }, @@ -242,53 +239,19 @@ buck-out/ "outputFileName": "react-native-alice-bobbi/android/build.gradle", "theContent": "// android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -315,79 +278,6 @@ dependencies { //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules } - -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} ", }, Object { @@ -453,24 +343,6 @@ public class AliceBobbiPackage implements ReactPackage { return Collections.emptyList(); } } -", - }, - Object { - "outputFileName": "react-native-alice-bobbi/android/README.md", - "theContent": "README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number ", }, Object { diff --git a/tests/with-mocks/lib/create/with-example/with-logging/with-null-options/with-null-prefix/__snapshots__/create-with-example-with-options.test.js.snap b/tests/with-mocks/lib/create/with-example/with-logging/with-null-options/with-null-prefix/__snapshots__/create-with-example-with-options.test.js.snap index 6279e3bc..3a7064aa 100644 --- a/tests/with-mocks/lib/create/with-example/with-logging/with-null-options/with-null-prefix/__snapshots__/create-with-example-with-options.test.js.snap +++ b/tests/with-mocks/lib/create/with-example/with-logging/with-null-options/with-null-prefix/__snapshots__/create-with-example-with-options.test.js.snap @@ -100,9 +100,6 @@ exampleReactNativeVersion: react-native@latest Object { "ensureDir": "react-native-alice-bobbi/android/src/main/java/com/reactlibrary/", }, - Object { - "ensureDir": "react-native-alice-bobbi/android/", - }, Object { "ensureDir": "react-native-alice-bobbi/", }, @@ -242,53 +239,19 @@ buck-out/ "outputFileName": "react-native-alice-bobbi/android/build.gradle", "theContent": "// android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -315,79 +278,6 @@ dependencies { //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules } - -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.reactlibrary\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} ", }, Object { @@ -453,24 +343,6 @@ public class AliceBobbiPackage implements ReactPackage { return Collections.emptyList(); } } -", - }, - Object { - "outputFileName": "react-native-alice-bobbi/android/README.md", - "theContent": "README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number ", }, Object { diff --git a/tests/with-mocks/lib/create/with-example/with-logging/with-options/__snapshots__/create-with-example-with-options.test.js.snap b/tests/with-mocks/lib/create/with-example/with-logging/with-options/__snapshots__/create-with-example-with-options.test.js.snap index 1d93beff..c2698c99 100644 --- a/tests/with-mocks/lib/create/with-example/with-logging/with-options/__snapshots__/create-with-example-with-options.test.js.snap +++ b/tests/with-mocks/lib/create/with-example/with-logging/with-options/__snapshots__/create-with-example-with-options.test.js.snap @@ -94,9 +94,6 @@ exampleReactNativeVersion: react-native@npm:react-native-tvos Object { "ensureDir": "react-native-alice-bobbi/android/src/main/java/com/alicebits/", }, - Object { - "ensureDir": "react-native-alice-bobbi/android/", - }, Object { "ensureDir": "react-native-alice-bobbi/", }, @@ -236,53 +233,19 @@ buck-out/ "outputFileName": "react-native-alice-bobbi/android/build.gradle", "theContent": "// android/build.gradle -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// previous location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle - -// These defaults should reflect the SDK versions used by -// the minimum React Native version supported. -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 - -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +def rootExtGet(prop) { + rootProject.ext.get(prop) } apply plugin: 'com.android.library' apply plugin: 'maven' -buildscript { - // The Android Gradle plugin is only required when opening the android folder stand-alone. - // This avoids unnecessary downloads and potential conflicts when the library is included as a - // module dependency in an application project. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies - if (project == rootProject) { - repositories { - google() - } - dependencies { - // This should reflect the Gradle plugin version used by - // the minimum React Native version supported. - classpath 'com.android.tools.build:gradle:3.4.1' - } - } -} - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + compileSdkVersion rootExtGet('compileSdkVersion') + buildToolsVersion rootExtGet('buildToolsVersion') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion rootExtGet('minSdkVersion') + targetSdkVersion rootExtGet('targetSdkVersion') versionCode 1 versionName \\"1.0\\" } @@ -309,79 +272,6 @@ dependencies { //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules } - -def configureReactNativePom(def pom) { - def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = \\"com.alicebits\\" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - - developers { - developer { - id packageJson.author.username - name packageJson.author.name - } - } - } -} - -afterEvaluate { project -> - // some Gradle build hooks ref: - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - def javaCompileTask = variant.javaCompileProvider.get() - - task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) { - from javaCompileTask.destinationDir - } - } - - artifacts { - archives androidSourcesJar - archives androidJavadocJar - } - - task installArchives(type: Upload) { - configuration = configurations.archives - repositories.mavenDeployer { - // Deploy to react-native-event-bridge/maven, ready to publish to npm - repository url: \\"file://\${projectDir}/../android/maven\\" - configureReactNativePom pom - } - } -} ", }, Object { @@ -447,24 +337,6 @@ public class ABCAliceBobbiPackage implements ReactPackage { return Collections.emptyList(); } } -", - }, - Object { - "outputFileName": "react-native-alice-bobbi/android/README.md", - "theContent": "README -====== - -If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: - -1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed -2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK -\`\`\` -ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle -sdk.dir=/Users/{username}/Library/Android/sdk -\`\`\` -3. Delete the \`maven\` folder -4. Run \`./gradlew installArchives\` -5. Verify that latest set of generated files is in the maven folder with the correct version number ", }, Object {