Skip to content

Commit 3c62120

Browse files
stuartmorganfranciscojma86
authored andcommitted
Fix Windows VS build (#215)
* Add checkout of jsoncpp back to the VS build script * Make fetch_jsoncpp handle the case where the source is already present
1 parent 040f84d commit 3c62120

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

library/windows/scripts/build_jsonlib.bat

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,10 @@
1212
:: See the License for the specific language governing permissions and
1313
:: limitations under the License.
1414
@echo off
15-
%~dp0..\..\..\tools\run_dart_tool.bat build_jsoncpp %~dp0..\third_party\jsoncpp %~dp0..\dependencies\JSON %*
15+
16+
set RUN_DART_TOOL=%~dp0..\..\..\tools\run_dart_tool.bat
17+
set CHECKOUT_DIR=%~dp0..\third_party\jsoncpp
18+
set ARTIFACT_DIR=%~dp0..\dependencies\JSON
19+
20+
call %RUN_DART_TOOL% fetch_jsoncpp %CHECKOUT_DIR%
21+
call %RUN_DART_TOOL% build_jsoncpp %CHECKOUT_DIR% %ARTIFACT_DIR% %*

tools/dart_tools/bin/fetch_jsoncpp.dart

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,15 @@ Future<void> main(List<String> arguments) async {
3838

3939
final downloadDirectory = arguments[0];
4040

41-
await runCommand('git', [
42-
'clone',
43-
gitRepo,
44-
downloadDirectory,
45-
]);
41+
if (Directory(downloadDirectory).existsSync()) {
42+
print('$downloadDirectory already exists; skipping clone');
43+
} else {
44+
await runCommand('git', [
45+
'clone',
46+
gitRepo,
47+
downloadDirectory,
48+
]);
49+
}
4650

4751
await runCommand(
4852
'git',

0 commit comments

Comments
 (0)