Skip to content

Commit 3d1cf58

Browse files
committed
Use short RNTA path for Windows Android CI
1 parent 593507f commit 3d1cf58

4 files changed

Lines changed: 10 additions & 18 deletions

File tree

.github/scripts/build-android.cmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ setlocal
33
rem subst the example app to a short drive to avoid Windows MAX_PATH in
44
rem CMake-generated object file names from autolinked codegen.
55
subst W: "%GITHUB_WORKSPACE%\example" || exit /b 1
6+
robocopy W:\node_modules\react-native-test-app W:\r /MIR /NFL /NDL /NJH /NJS /NP
7+
if %ERRORLEVEL% GEQ 8 exit /b %ERRORLEVEL%
68
cd /D W:\android || exit /b 1
79
call gradlew.bat assembleDebug -PnewArchEnabled=%1

.github/workflows/android.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ jobs:
4949
- name: Install example app dependencies
5050
run: yarn install
5151
working-directory: example
52-
- name: Enable Windows long paths
53-
if: runner.os == 'Windows'
54-
shell: powershell
55-
run: New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
5652
- name: Build android example app with new arch disabled
5753
run: ./.github/scripts/build-android.sh false
5854
android-build-fabric:
@@ -87,9 +83,5 @@ jobs:
8783
- name: Install example app dependencies
8884
run: yarn install
8985
working-directory: example
90-
- name: Enable Windows long paths
91-
if: runner.os == 'Windows'
92-
shell: powershell
93-
run: New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
9486
- name: Build android example app with new arch enabled
9587
run: ./.github/scripts/build-android.sh true

example/android/build.gradle

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,5 @@ allprojects {
4242
}
4343
}
4444

45-
subprojects { subproject ->
46-
subproject.plugins.withId("com.android.application") {
47-
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
48-
subproject.android.defaultConfig.externalNativeBuild.cmake.arguments(
49-
"-DCMAKE_OBJECT_PATH_MAX=128"
50-
)
51-
}
52-
}
53-
}
54-
5545
rootProject.ext.set("react.compileSdkVersion", 36)
5646
rootProject.ext.set("react.targetSdkVersion", 36)

example/android/settings.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@ apply(from: {
1919
throw new GradleException("Could not find `react-native-test-app`");
2020
}())
2121
applyTestAppSettings(settings)
22+
23+
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
24+
def shortTestAppAndroidDir = file("../r")
25+
if (shortTestAppAndroidDir.exists()) {
26+
project(":app").projectDir = file("${shortTestAppAndroidDir}/android/app")
27+
project(":support").projectDir = file("${shortTestAppAndroidDir}/android/support")
28+
}
29+
}

0 commit comments

Comments
 (0)