@@ -77,30 +77,12 @@ steps:
7777 displayName: Init new app project with @react-native-community/cli init
7878 workingDirectory: $(Agent.BuildDirectory)
7979
80- - ${{ if and( endsWith(parameters.template, '-lib'), not(startsWith(parameters.template, 'old')) ) }} :
80+ - ${{ if endsWith(parameters.template, '-lib') }} :
8181 - script : |
8282 npx --yes create-react-native-library@latest --slug testcli --description testcli --author-name "React-Native-Windows Bot" --author-email 53619745+rnbot@users.noreply.github.com --author-url http://example.com --repo-url http://example.com --languages kotlin-objc --type turbo-module --react-native-version $(reactNativeDevDependency) --example vanilla testcli
8383 displayName: Init new lib project with create-react-native-library
8484 workingDirectory: $(Agent.BuildDirectory)
8585
86- - ${{ elseif and(endsWith(parameters.template, '-lib'), startsWith(parameters.template, 'old')) }} :
87- - script : |
88- npx --yes create-react-native-module@0.20.2 --package-name "testcli" testcli
89- displayName: Init new lib project with create-react-native-module
90- workingDirectory: $(Agent.BuildDirectory)
91-
92- - script : |
93- rmdir /s /q android
94- displayName: Remove broken android folder # See issue https://github.com/microsoft/react-native-windows/issues/12209
95- workingDirectory: $(Agent.BuildDirectory)\testcli
96-
97- - script : |
98- call yarn install
99- call yarn upgrade react@$(reactDevDependency) --dev
100- call yarn upgrade react-native@$(reactNativeDevDependency) --dev
101- displayName: Update lib project react and react-native dev versions
102- workingDirectory: $(Agent.BuildDirectory)\testcli
103-
10486 - script : |
10587 call yarn install
10688 displayName: pre-windows yarn install
@@ -156,22 +138,21 @@ steps:
156138 - ${{ if eq(parameters.useExperimentalWinUI3, true) }} :
157139 - template : ../templates/enable-experimental-winui3.yml
158140 parameters :
159- ${{ if and( endsWith(parameters.template, '-lib'), not(startsWith(parameters.template, 'old')) ) }} :
141+ ${{ if endsWith(parameters.template, '-lib') }} :
160142 workingDir : $(Agent.BuildDirectory)\testcli\example\windows
161143 ${{ else }} :
162144 workingDir : $(Agent.BuildDirectory)\testcli\windows
163145
164- - ${{ if or(endsWith(parameters.template, '-app'), and(endsWith(parameters.template, '-lib'), not(startsWith(parameters.template, 'old')))) }} :
165- - powershell : |
166- $path = (Get-ChildItem -Filter "Package.appxmanifest" -File -Recurse).FullName;
167- [xml] $manifest = Get-Content $path
168- $manifest.Package.Identity.Name = 'ReactNative.InitTest'
169- $manifest.Save("$path")
170- displayName: Set AppX package name to "ReactNative.InitTest"
171- ${{ if and(endsWith(parameters.template, '-lib'), not(startsWith(parameters.template, 'old'))) }}:
172- workingDirectory: $(Agent.BuildDirectory)\testcli\example\windows
173- ${{ else }}:
174- workingDirectory: $(Agent.BuildDirectory)\testcli\windows
146+ - powershell : |
147+ $path = (Get-ChildItem -Filter "Package.appxmanifest" -File -Recurse).FullName;
148+ [xml] $manifest = Get-Content $path
149+ $manifest.Package.Identity.Name = 'ReactNative.InitTest'
150+ $manifest.Save("$path")
151+ displayName: Set AppX package name to "ReactNative.InitTest"
152+ ${{ if endsWith(parameters.template, '-lib') }}:
153+ workingDirectory: $(Agent.BuildDirectory)\testcli\example\windows
154+ ${{ else }}:
155+ workingDirectory: $(Agent.BuildDirectory)\testcli\windows
175156
176157 # End npm test server
177158 - template : verdaccio-stop.yml
@@ -184,7 +165,7 @@ steps:
184165
185166 - template : react-native-debug-info.yml
186167 parameters :
187- ${{ if and( endsWith(parameters.template, '-lib'), not(startsWith(parameters.template, 'old')) ) }} :
168+ ${{ if endsWith(parameters.template, '-lib') }} :
188169 workingDirectory : $(Agent.BuildDirectory)\testcli\example
189170 ${{ else }} :
190171 workingDirectory : $(Agent.BuildDirectory)\testcli
@@ -205,7 +186,7 @@ steps:
205186 buildPlatform : ${{ parameters.platform }}
206187 deployOption : ${{ parameters.additionalRunArguments }}
207188 buildLogDirectory : $(Build.BinariesDirectory)\${{ parameters.platform }}\${{ parameters.configuration }}\BuildLogs
208- ${{ if and( endsWith(parameters.template, '-lib'), not(startsWith(parameters.template, 'old')) ) }} :
189+ ${{ if endsWith(parameters.template, '-lib') }} :
209190 workingDirectory : $(Agent.BuildDirectory)\testcli\example
210191 ${{ else }} :
211192 workingDirectory : $(Agent.BuildDirectory)\testcli
@@ -218,7 +199,7 @@ steps:
218199
219200 # #13705 - Temporarily disable test:windows call until we get upstream fix
220201 # Only run the following on fabric apps
221- # - ${{ if and(endsWith(parameters.template, '-app'), not(startsWith(parameters.template, 'old')) ) }}:
202+ # - ${{ if and(endsWith(parameters.template, '-app')) }}:
222203 # - script: call yarn test:windows
223204 # displayName: Run jest tests with react-test-renderer
224205 # workingDirectory: $(Agent.BuildDirectory)\testcli
0 commit comments