Skip to content

Commit

Permalink
Merge pull request #1306 from flexn-io/fix/add_customization
Browse files Browse the repository at this point in the history
Fix/add customization
  • Loading branch information
mihaiblaga89 authored Dec 20, 2023
2 parents 706bae7 + 713192a commit 85cd786
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = "testRNProject"
rootProject.name = '{{RN_GRADLE_PROJECT_NAME}}'
apply from: file("{{RN_CLI_LOCATION}}/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('{{RN_GRADLE_PLUGIN_LOCATION}}')
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = "testRNProject"
rootProject.name = '{{RN_GRADLE_PROJECT_NAME}}'
apply from: file("{{RN_CLI_LOCATION}}/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('{{RN_GRADLE_PLUGIN_LOCATION}}')
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = "testRNProject"
rootProject.name = '{{RN_GRADLE_PROJECT_NAME}}'
apply from: file("{{RN_CLI_LOCATION}}/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('{{RN_GRADLE_PLUGIN_LOCATION}}')
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = "testRNProject"
rootProject.name = '{{RN_GRADLE_PROJECT_NAME}}'
apply from: file("{{RN_CLI_LOCATION}}/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('{{RN_GRADLE_PLUGIN_LOCATION}}')
5 changes: 4 additions & 1 deletion packages/sdk-android/src/deviceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ export const launchAndroidSimulator = async (
target: true | { name: string } | string,
isIndependentThread = false
) => {
logTask('launchAndroidSimulator', `target:${target} independentThread:${!!isIndependentThread}`);
logTask(
'launchAndroidSimulator',
`target:${typeof target === 'object' ? target?.name : target} independentThread:${!!isIndependentThread}`
);
let newTarget: { name: string } | string;
if (target === true) {
const {
Expand Down
8 changes: 6 additions & 2 deletions packages/sdk-android/src/gradleParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,9 @@ export const parseSettingsGradleSync = (c: Context) => {
const rnCliLocation = doResolve('@react-native-community/cli-platform-android', true, { forceForwardPaths: true });
const rnGradlePluginLocation = doResolve('@react-native/gradle-plugin', true, { forceForwardPaths: true });

const rnCliRelativePath = (!!rnCliLocation && path.relative(appFolder, rnCliLocation)) || '';
const rnCliRelativePath = (!!rnCliLocation && path.relative(appFolder, rnCliLocation).replace(/\\/g, '/')) || '';
const rnGradlePluginRelativePath =
(!!rnGradlePluginLocation && path.relative(appFolder, rnGradlePluginLocation)) || '';
(!!rnGradlePluginLocation && path.relative(appFolder, rnGradlePluginLocation).replace(/\\/g, '/')) || '';

const injects = [
{
Expand All @@ -544,6 +544,10 @@ export const parseSettingsGradleSync = (c: Context) => {
pattern: '{{RN_GRADLE_PLUGIN_LOCATION}}',
override: rnGradlePluginRelativePath,
},
{
pattern: '{{RN_GRADLE_PROJECT_NAME}}',
override: c.files.project.config?.projectName.replace('/', '-'),
},
];

addSystemInjects(c, injects);
Expand Down

0 comments on commit 85cd786

Please sign in to comment.