File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
packages/cli-config-android/src/config Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,19 @@ function generateValidFileStructureForApp() {
7171 } ;
7272}
7373
74+ function generateValidFileStructureForAppWithCustomAppName (
75+ customAppName : string ,
76+ ) {
77+ return {
78+ 'build.gradle' : buildGradle ,
79+ [ customAppName ] : {
80+ 'build.gradle' : appBuildGradle ,
81+ } ,
82+ src : {
83+ 'AndroidManifest.xml' : manifest ,
84+ } ,
85+ } ;
86+ }
7487export const valid = generateValidFileStructureForLib ( 'ReactPackage.java' ) ;
7588
7689export const validKotlin = generateValidFileStructureForLib ( 'ReactPackage.kt' ) ;
@@ -83,6 +96,9 @@ export const validKotlinWithDifferentFileName =
8396
8497export const validApp = generateValidFileStructureForApp ( ) ;
8598
99+ export const validAppWithCustomAppName =
100+ generateValidFileStructureForAppWithCustomAppName ( 'custom' ) ;
101+
86102export const userConfigManifest = {
87103 src : {
88104 main : {
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ describe('findBuildGradle for apps', () => {
2121 flat : {
2222 android : mocks . validApp ,
2323 } ,
24+ customPath : {
25+ android : mocks . validAppWithCustomAppName ,
26+ } ,
2427 } ) ;
2528 } ) ;
2629
@@ -33,6 +36,12 @@ describe('findBuildGradle for apps', () => {
3336 it ( 'returns `null` if there is no gradle in the app folder' , ( ) => {
3437 expect ( findBuildGradle ( '/empty' , 'app' ) ) . toBeNull ( ) ;
3538 } ) ;
39+
40+ it ( 'returns the app build.gradle with custom app name' , ( ) => {
41+ expect ( findBuildGradle ( '/customPath/android' , 'custom' ) ) . toBe (
42+ '/customPath/android/custom/build.gradle' ,
43+ ) ;
44+ } ) ;
3645} ) ;
3746
3847describe ( 'findBuildGradle for libraries' , ( ) => {
You can’t perform that action at this time.
0 commit comments