@react-native-windows/cli 0.0.0-canary.1 → 0.0.0-canary.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/lib-commonjs/config/configUtils.d.ts +27 -6
- package/lib-commonjs/config/configUtils.js +122 -45
- package/lib-commonjs/config/configUtils.js.map +1 -1
- package/lib-commonjs/config/dependencyConfig.d.ts +3 -3
- package/lib-commonjs/config/dependencyConfig.js +128 -54
- package/lib-commonjs/config/dependencyConfig.js.map +1 -1
- package/lib-commonjs/config/projectConfig.d.ts +6 -3
- package/lib-commonjs/config/projectConfig.js +68 -12
- package/lib-commonjs/config/projectConfig.js.map +1 -1
- package/lib-commonjs/e2etest/autolink.test.d.ts +6 -0
- package/lib-commonjs/e2etest/autolink.test.js +435 -0
- package/lib-commonjs/e2etest/autolink.test.js.map +1 -0
- package/lib-commonjs/e2etest/dependencyConfig.test.d.ts +6 -0
- package/lib-commonjs/e2etest/dependencyConfig.test.js +162 -0
- package/lib-commonjs/e2etest/dependencyConfig.test.js.map +1 -0
- package/lib-commonjs/e2etest/projectConfig.test.d.ts +6 -0
- package/lib-commonjs/e2etest/projectConfig.test.js +125 -0
- package/lib-commonjs/e2etest/projectConfig.test.js.map +1 -0
- package/lib-commonjs/e2etest/projectConfig.utils.d.ts +4 -0
- package/lib-commonjs/e2etest/projectConfig.utils.js +63 -0
- package/lib-commonjs/e2etest/projectConfig.utils.js.map +1 -0
- package/lib-commonjs/e2etest/runWindows.test.d.ts +6 -0
- package/lib-commonjs/e2etest/runWindows.test.js +61 -0
- package/lib-commonjs/e2etest/runWindows.test.js.map +1 -0
- package/lib-commonjs/generator-common/index.d.ts +16 -0
- package/lib-commonjs/generator-common/index.js +60 -39
- package/lib-commonjs/generator-common/index.js.map +1 -1
- package/lib-commonjs/generator-windows/index.d.ts +2 -2
- package/lib-commonjs/generator-windows/index.js +250 -145
- package/lib-commonjs/generator-windows/index.js.map +1 -1
- package/lib-commonjs/healthChecks.d.ts +2 -0
- package/lib-commonjs/healthChecks.js +88 -0
- package/lib-commonjs/healthChecks.js.map +1 -0
- package/lib-commonjs/index.d.ts +5 -0
- package/lib-commonjs/index.js +24 -6
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/runWindows/runWindows.js +203 -55
- package/lib-commonjs/runWindows/runWindows.js.map +1 -1
- package/lib-commonjs/runWindows/runWindowsOptions.d.ts +16 -10
- package/lib-commonjs/runWindows/runWindowsOptions.js +19 -11
- package/lib-commonjs/runWindows/runWindowsOptions.js.map +1 -1
- package/lib-commonjs/runWindows/utils/autolink.d.ts +88 -1
- package/lib-commonjs/runWindows/utils/autolink.js +592 -250
- package/lib-commonjs/runWindows/utils/autolink.js.map +1 -1
- package/lib-commonjs/runWindows/utils/build.d.ts +1 -2
- package/lib-commonjs/runWindows/utils/build.js +26 -33
- package/lib-commonjs/runWindows/utils/build.js.map +1 -1
- package/lib-commonjs/runWindows/utils/checkRequirements.js +11 -7
- package/lib-commonjs/runWindows/utils/checkRequirements.js.map +1 -1
- package/lib-commonjs/runWindows/utils/commandWithProgress.d.ts +11 -3
- package/lib-commonjs/runWindows/utils/commandWithProgress.js +57 -22
- package/lib-commonjs/runWindows/utils/commandWithProgress.js.map +1 -1
- package/lib-commonjs/runWindows/utils/deploy.d.ts +1 -1
- package/lib-commonjs/runWindows/utils/deploy.js +164 -82
- package/lib-commonjs/runWindows/utils/deploy.js.map +1 -1
- package/lib-commonjs/runWindows/utils/info.js +5 -2
- package/lib-commonjs/runWindows/utils/info.js.map +1 -1
- package/lib-commonjs/runWindows/utils/msbuildtools.d.ts +9 -5
- package/lib-commonjs/runWindows/utils/msbuildtools.js +95 -58
- package/lib-commonjs/runWindows/utils/msbuildtools.js.map +1 -1
- package/lib-commonjs/runWindows/utils/telemetryHelpers.d.ts +29 -0
- package/lib-commonjs/runWindows/utils/telemetryHelpers.js +109 -0
- package/lib-commonjs/runWindows/utils/telemetryHelpers.js.map +1 -0
- package/lib-commonjs/runWindows/utils/version.d.ts +4 -4
- package/lib-commonjs/runWindows/utils/version.js.map +1 -1
- package/lib-commonjs/runWindows/utils/vsInstalls.d.ts +4 -1
- package/lib-commonjs/runWindows/utils/vsInstalls.js +22 -7
- package/lib-commonjs/runWindows/utils/vsInstalls.js.map +1 -1
- package/lib-commonjs/runWindows/utils/vstools.d.ts +1 -0
- package/lib-commonjs/runWindows/utils/vstools.js +44 -25
- package/lib-commonjs/runWindows/utils/vstools.js.map +1 -1
- package/lib-commonjs/runWindows/utils/winappdeploytool.d.ts +3 -3
- package/lib-commonjs/runWindows/utils/winappdeploytool.js +17 -14
- package/lib-commonjs/runWindows/utils/winappdeploytool.js.map +1 -1
- package/package.json +43 -27
- package/powershell/Add-AppDevPackage.ps1 +2 -2
- package/powershell/WindowsStoreAppUtils.ps1 +11 -1
- package/CHANGELOG.json +0 -20
- package/CHANGELOG.md +0 -13
- package/templates/_gitignore +0 -92
- package/templates/b_gitignore +0 -1
- package/templates/cpp/keys/MyApp_TemporaryKey.pfx +0 -0
- package/templates/cpp/proj/MyApp.sln +0 -194
- package/templates/cpp/proj/MyApp.vcxproj +0 -220
- package/templates/cpp/proj/MyApp.vcxproj.filters +0 -63
- package/templates/cpp/proj/packages.config +0 -6
- package/templates/cpp/src/App.cpp +0 -80
- package/templates/cpp/src/App.h +0 -25
- package/templates/cpp/src/App.idl +0 -3
- package/templates/cpp/src/AutolinkedNativeModules.g.cpp +0 -13
- package/templates/cpp/src/AutolinkedNativeModules.g.h +0 -10
- package/templates/cpp/src/AutolinkedNativeModules.g.targets +0 -6
- package/templates/cpp/src/MainPage.cpp +0 -24
- package/templates/cpp/src/MainPage.h +0 -21
- package/templates/cpp/src/MainPage.idl +0 -8
- package/templates/cpp/src/PropertySheet.props +0 -16
- package/templates/cpp/src/ReactPackageProvider.cpp +0 -18
- package/templates/cpp/src/ReactPackageProvider.h +0 -15
- package/templates/cpp/src/pch.cpp +0 -1
- package/templates/cpp/src/pch.h +0 -26
- package/templates/cs/keys/MyApp_TemporaryKey.pfx +0 -0
- package/templates/cs/proj/MyApp.csproj +0 -189
- package/templates/cs/proj/MyApp.sln +0 -208
- package/templates/cs/src/App.xaml.cs +0 -56
- package/templates/cs/src/AutolinkedNativeModules.g.cs +0 -13
- package/templates/cs/src/AutolinkedNativeModules.g.targets +0 -6
- package/templates/cs/src/MainPage.xaml.cs +0 -33
- package/templates/cs/src/Properties/AssemblyInfo.cs +0 -29
- package/templates/cs/src/Properties/Default.rd.xml +0 -32
- package/templates/index.windows.bundle +0 -9
- package/templates/metro.config.js +0 -29
- package/templates/shared/assets/LockScreenLogo.scale-200.png +0 -0
- package/templates/shared/assets/SplashScreen.scale-200.png +0 -0
- package/templates/shared/assets/Square150x150Logo.scale-200.png +0 -0
- package/templates/shared/assets/Square44x44Logo.scale-200.png +0 -0
- package/templates/shared/assets/Square44x44Logo.targetsize-24_altform-unplated.png +0 -0
- package/templates/shared/assets/StoreLogo.png +0 -0
- package/templates/shared/assets/Wide310x150Logo.scale-200.png +0 -0
- package/templates/shared/proj/NuGet.Config +0 -13
- package/templates/shared/src/App.xaml +0 -10
- package/templates/shared/src/MainPage.xaml +0 -21
- package/templates/shared/src/Package.appxmanifest +0 -50
|
@@ -4,55 +4,80 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
* @format
|
|
6
6
|
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
7
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
30
|
const os_1 = require("os");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const version_1 = require("./version");
|
|
16
|
-
const checkRequirements = require("./checkRequirements");
|
|
31
|
+
const fs_1 = __importDefault(require("@react-native-windows/fs"));
|
|
32
|
+
const path_1 = __importDefault(require("path"));
|
|
33
|
+
const child_process_1 = __importDefault(require("child_process"));
|
|
34
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
35
|
+
const os_2 = __importDefault(require("os"));
|
|
36
|
+
const shelljs_1 = __importDefault(require("shelljs"));
|
|
37
|
+
const version_1 = __importDefault(require("./version"));
|
|
38
|
+
const checkRequirements = __importStar(require("./checkRequirements"));
|
|
17
39
|
const commandWithProgress_1 = require("./commandWithProgress");
|
|
18
|
-
const
|
|
40
|
+
const child_process_2 = require("child_process");
|
|
19
41
|
const vsInstalls_1 = require("./vsInstalls");
|
|
42
|
+
const telemetry_1 = require("@react-native-windows/telemetry");
|
|
20
43
|
class MSBuildTools {
|
|
21
44
|
/**
|
|
22
45
|
* @param version is something like 16.0 for 2019
|
|
23
|
-
* @param
|
|
46
|
+
* @param installationPath Path to installation root
|
|
24
47
|
* @param installationVersion is the full version e.g. 16.3.29411.108
|
|
25
48
|
*/
|
|
26
|
-
constructor(version,
|
|
49
|
+
constructor(version, installationPath, installationVersion) {
|
|
27
50
|
this.version = version;
|
|
28
|
-
this.
|
|
51
|
+
this.installationPath = installationPath;
|
|
29
52
|
this.installationVersion = installationVersion;
|
|
30
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* @returns directory where x86 msbuild can be found
|
|
56
|
+
*/
|
|
57
|
+
msbuildPath() {
|
|
58
|
+
return path_1.default.join(this.installationPath, 'MSBuild/Current/Bin');
|
|
59
|
+
}
|
|
31
60
|
cleanProject(slnFile) {
|
|
32
|
-
const cmd = `"${
|
|
33
|
-
const results =
|
|
61
|
+
const cmd = `"${path_1.default.join(this.msbuildPath(), 'msbuild.exe')}" "${slnFile}" /t:Clean`;
|
|
62
|
+
const results = child_process_1.default
|
|
34
63
|
.execSync(cmd)
|
|
35
64
|
.toString()
|
|
36
65
|
.split(os_1.EOL);
|
|
37
|
-
results.forEach(result => console.log(
|
|
66
|
+
results.forEach(result => console.log(chalk_1.default.white(result)));
|
|
38
67
|
}
|
|
39
|
-
async buildProject(slnFile, buildType, buildArch, msBuildProps, verbose, target, buildLogDirectory) {
|
|
40
|
-
commandWithProgress_1.newSuccess(`Found Solution: ${slnFile}`);
|
|
41
|
-
commandWithProgress_1.newInfo(`Build configuration: ${buildType}`);
|
|
42
|
-
commandWithProgress_1.newInfo(`Build platform: ${buildArch}`);
|
|
43
|
-
if (target) {
|
|
44
|
-
commandWithProgress_1.newInfo(`Build target: ${target}`);
|
|
45
|
-
}
|
|
68
|
+
async buildProject(slnFile, buildType, buildArch, msBuildProps, verbose, target, buildLogDirectory, singleproc) {
|
|
69
|
+
(0, commandWithProgress_1.newSuccess)(`Found Solution: ${slnFile}`);
|
|
70
|
+
(0, commandWithProgress_1.newInfo)(`Build configuration: ${buildType}`);
|
|
71
|
+
(0, commandWithProgress_1.newInfo)(`Build platform: ${buildArch}`);
|
|
46
72
|
const verbosityOption = verbose ? 'normal' : 'minimal';
|
|
47
|
-
const logPrefix =
|
|
73
|
+
const logPrefix = path_1.default.join(buildLogDirectory || os_2.default.tmpdir(), `msbuild_${process.pid}_${target}`);
|
|
48
74
|
const errorLog = logPrefix + '.err';
|
|
49
75
|
const warnLog = logPrefix + '.wrn';
|
|
50
|
-
const localBinLog = target ?
|
|
76
|
+
const localBinLog = target === 'build' ? '' : ':deploy.binlog';
|
|
51
77
|
const binlog = buildLogDirectory ? `:${logPrefix}.binlog` : localBinLog;
|
|
52
78
|
const args = [
|
|
53
79
|
`/clp:NoSummary;NoItemAndPropertyList;Verbosity=${verbosityOption}`,
|
|
54
80
|
'/nologo',
|
|
55
|
-
'/maxCpuCount',
|
|
56
81
|
`/p:Configuration=${buildType}`,
|
|
57
82
|
`/p:Platform=${buildArch}`,
|
|
58
83
|
'/p:AppxBundle=Never',
|
|
@@ -60,68 +85,82 @@ class MSBuildTools {
|
|
|
60
85
|
`/flp1:errorsonly;logfile=${errorLog}`,
|
|
61
86
|
`/flp2:warningsonly;logfile=${warnLog}`,
|
|
62
87
|
];
|
|
63
|
-
|
|
64
|
-
|
|
88
|
+
// Building projects in parallel increases compiler memory usage and
|
|
89
|
+
// doesn't lead to dramatic performance gains (See #4739). Only enable
|
|
90
|
+
// parallel builds on machines with >16GB of memory to avoid OOM errors
|
|
91
|
+
const highMemory = (0, os_1.totalmem)() > 16 * 1024 * 1024 * 1024;
|
|
92
|
+
const enableParallelBuilds = singleproc === false || highMemory;
|
|
93
|
+
if (enableParallelBuilds) {
|
|
94
|
+
args.push('/maxCpuCount');
|
|
95
|
+
}
|
|
96
|
+
if (target === 'build') {
|
|
97
|
+
args.push('/restore', '/p:RestorePackagesConfig=true');
|
|
65
98
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
args.push(`/p:${key}=${msBuildProps[key]}`);
|
|
69
|
-
});
|
|
99
|
+
else {
|
|
100
|
+
args.push(`/t:Deploy`);
|
|
70
101
|
}
|
|
102
|
+
Object.keys(msBuildProps).forEach(key => {
|
|
103
|
+
args.push(`/p:${key}=${msBuildProps[key]}`);
|
|
104
|
+
});
|
|
71
105
|
try {
|
|
72
106
|
checkRequirements.isWinSdkPresent('10.0');
|
|
73
107
|
}
|
|
74
108
|
catch (e) {
|
|
75
|
-
commandWithProgress_1.newError(e.message);
|
|
109
|
+
(0, commandWithProgress_1.newError)(e.message);
|
|
76
110
|
throw e;
|
|
77
111
|
}
|
|
78
112
|
if (verbose) {
|
|
79
113
|
console.log(`Running MSBuild with args ${args.join(' ')}`);
|
|
80
114
|
}
|
|
81
|
-
const progressName = 'Building Solution';
|
|
82
|
-
const spinner = commandWithProgress_1.newSpinner(progressName);
|
|
115
|
+
const progressName = target === 'deploy' ? 'Deploying Solution' : 'Building Solution';
|
|
116
|
+
const spinner = (0, commandWithProgress_1.newSpinner)(progressName);
|
|
83
117
|
try {
|
|
84
|
-
await commandWithProgress_1.commandWithProgress(spinner, progressName,
|
|
118
|
+
await (0, commandWithProgress_1.commandWithProgress)(spinner, progressName, path_1.default.join(this.msbuildPath(), 'msbuild.exe'), [slnFile].concat(args), verbose, 'MSBuildError');
|
|
85
119
|
}
|
|
86
120
|
catch (e) {
|
|
87
121
|
let error = e;
|
|
88
122
|
if (!e) {
|
|
89
|
-
const firstMessage = (await
|
|
123
|
+
const firstMessage = (await fs_1.default.readFile(errorLog))
|
|
90
124
|
.toString()
|
|
91
125
|
.split(os_1.EOL)[0];
|
|
92
|
-
error = new
|
|
126
|
+
error = new telemetry_1.CodedError('MSBuildError', firstMessage);
|
|
93
127
|
error.logfile = errorLog;
|
|
94
128
|
}
|
|
95
129
|
throw error;
|
|
96
130
|
}
|
|
97
131
|
// If we have no errors, delete the error log when we're done
|
|
98
|
-
if ((await
|
|
99
|
-
await
|
|
132
|
+
if ((await fs_1.default.stat(errorLog)).size === 0) {
|
|
133
|
+
await fs_1.default.unlink(errorLog);
|
|
100
134
|
}
|
|
101
135
|
}
|
|
102
|
-
static findAvailableVersion(buildArch, verbose) {
|
|
136
|
+
static findAvailableVersion(buildArch, verbose, prerelease) {
|
|
103
137
|
// https://aka.ms/vs/workloads
|
|
104
138
|
const requires = [
|
|
105
139
|
'Microsoft.Component.MSBuild',
|
|
106
140
|
getVCToolsByArch(buildArch),
|
|
107
141
|
];
|
|
108
|
-
const
|
|
109
|
-
const vsInstallation = vsInstalls_1.findLatestVsInstall({
|
|
142
|
+
const minVersion = process.env.VisualStudioVersion || '16.7';
|
|
143
|
+
const vsInstallation = (0, vsInstalls_1.findLatestVsInstall)({
|
|
144
|
+
requires,
|
|
145
|
+
minVersion,
|
|
146
|
+
verbose,
|
|
147
|
+
prerelease,
|
|
148
|
+
});
|
|
110
149
|
if (!vsInstallation) {
|
|
111
150
|
if (process.env.VisualStudioVersion != null) {
|
|
112
|
-
throw new
|
|
151
|
+
throw new telemetry_1.CodedError('NoMSBuild', `MSBuild tools not found for version ${process.env.VisualStudioVersion} (from environment). Make sure all required components have been installed`, { VisualStudioVersionFromEnv: process.env.VisualStudioVersion });
|
|
113
152
|
}
|
|
114
153
|
else {
|
|
115
|
-
throw new
|
|
154
|
+
throw new telemetry_1.CodedError('NoMSBuild', `Could not find MSBuild with VCTools for Visual Studio ${minVersion} or later. Make sure all required components have been installed`, { minVersion: minVersion });
|
|
116
155
|
}
|
|
117
156
|
}
|
|
118
|
-
const toolsPath =
|
|
119
|
-
if (
|
|
120
|
-
commandWithProgress_1.newSuccess(`Found MSBuild
|
|
121
|
-
return new MSBuildTools(
|
|
157
|
+
const toolsPath = path_1.default.join(vsInstallation.installationPath, 'MSBuild/Current/Bin');
|
|
158
|
+
if (fs_1.default.existsSync(toolsPath)) {
|
|
159
|
+
(0, commandWithProgress_1.newSuccess)(`Found compatible MSBuild at ${toolsPath} (${vsInstallation.installationVersion})`);
|
|
160
|
+
return new MSBuildTools(minVersion, vsInstallation.installationPath, vsInstallation.installationVersion);
|
|
122
161
|
}
|
|
123
162
|
else {
|
|
124
|
-
throw new
|
|
163
|
+
throw new telemetry_1.CodedError('NoMSBuild', `MSBuild path '${toolsPath} does not exist'`);
|
|
125
164
|
}
|
|
126
165
|
}
|
|
127
166
|
static getAllAvailableUAPVersions() {
|
|
@@ -131,21 +170,21 @@ class MSBuildTools {
|
|
|
131
170
|
if (!programFilesFolder) {
|
|
132
171
|
return results;
|
|
133
172
|
}
|
|
134
|
-
let uapFolderPath =
|
|
135
|
-
if (!
|
|
173
|
+
let uapFolderPath = path_1.default.join(programFilesFolder, 'Windows Kits', '10', 'Platforms', 'UAP');
|
|
174
|
+
if (!shelljs_1.default.test('-e', uapFolderPath)) {
|
|
136
175
|
// Check other installation folder from reg
|
|
137
176
|
const sdkFolder = getSDK10InstallationFolder();
|
|
138
177
|
if (sdkFolder) {
|
|
139
|
-
uapFolderPath =
|
|
178
|
+
uapFolderPath = path_1.default.join(sdkFolder, 'Platforms', 'UAP');
|
|
140
179
|
}
|
|
141
180
|
}
|
|
142
181
|
// No UAP SDK exists on this machine
|
|
143
|
-
if (!
|
|
182
|
+
if (!shelljs_1.default.test('-e', uapFolderPath)) {
|
|
144
183
|
return results;
|
|
145
184
|
}
|
|
146
|
-
|
|
185
|
+
shelljs_1.default
|
|
147
186
|
.ls(uapFolderPath)
|
|
148
|
-
.filter(uapDir =>
|
|
187
|
+
.filter(uapDir => shelljs_1.default.test('-d', path_1.default.join(uapFolderPath, uapDir)))
|
|
149
188
|
.map(version_1.default.tryParse)
|
|
150
189
|
.forEach(version => version && results.push(version));
|
|
151
190
|
return results;
|
|
@@ -157,8 +196,6 @@ function getVCToolsByArch(buildArch) {
|
|
|
157
196
|
case 'x86':
|
|
158
197
|
case 'x64':
|
|
159
198
|
return 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64';
|
|
160
|
-
case 'ARM':
|
|
161
|
-
return 'Microsoft.VisualStudio.Component.VC.Tools.ARM';
|
|
162
199
|
case 'ARM64':
|
|
163
200
|
return 'Microsoft.VisualStudio.Component.VC.Tools.ARM64';
|
|
164
201
|
}
|
|
@@ -168,7 +205,7 @@ function getSDK10InstallationFolder() {
|
|
|
168
205
|
const execString = 'reg query "HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v10.0" /s /v InstallationFolder /reg:32';
|
|
169
206
|
let output;
|
|
170
207
|
try {
|
|
171
|
-
output =
|
|
208
|
+
output = (0, child_process_2.execSync)(execString).toString();
|
|
172
209
|
}
|
|
173
210
|
catch (e) {
|
|
174
211
|
return folder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"msbuildtools.js","sourceRoot":"","sources":["../../../src/runWindows/utils/msbuildtools.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAEH,2BAAuB;AACvB,yBAAyB;AACzB,6BAA6B;AAC7B,+CAA+C;AAC/C,+BAA+B;AAC/B,yBAAyB;AACzB,iCAAiC;AACjC,uCAAgC;AAChC,yDAAyD;AACzD,+DAM+B;AAC/B,iDAAuC;AAEvC,6CAAiD;AAEjD,MAAqB,YAAY;IAC/B;;;;OAIG;IACH,YACkB,OAAe,EACf,WAAmB,EACnB,mBAA2B;QAF3B,YAAO,GAAP,OAAO,CAAQ;QACf,gBAAW,GAAX,WAAW,CAAQ;QACnB,wBAAmB,GAAnB,mBAAmB,CAAQ;IAC1C,CAAC;IAEJ,YAAY,CAAC,OAAe;QAC1B,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,CACvB,IAAI,CAAC,WAAW,EAChB,aAAa,CACd,MAAM,OAAO,YAAY,CAAC;QAC3B,MAAM,OAAO,GAAG,aAAa;aAC1B,QAAQ,CAAC,GAAG,CAAC;aACb,QAAQ,EAAE;aACV,KAAK,CAAC,QAAG,CAAC,CAAC;QACd,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,OAAe,EACf,SAAsB,EACtB,SAAoB,EACpB,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C,CAAC,CAAC;KACjB;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport {totalmem, EOL} from 'os';\nimport fs from '@react-native-windows/fs';\nimport path from 'path';\nimport child_process from 'child_process';\nimport chalk from 'chalk';\nimport os from 'os';\nimport shell from 'shelljs';\nimport Version from './version';\nimport * as checkRequirements from './checkRequirements';\nimport {\n commandWithProgress,\n newInfo,\n newSpinner,\n newSuccess,\n newError,\n} from './commandWithProgress';\nimport {execSync} from 'child_process';\nimport {BuildArch, BuildConfig} from '../runWindowsOptions';\nimport {findLatestVsInstall} from './vsInstalls';\nimport {CodedError} from '@react-native-windows/telemetry';\n\nexport default class MSBuildTools {\n /**\n * @param version is something like 16.0 for 2019\n * @param installationPath Path to installation root\n * @param installationVersion is the full version e.g. 16.3.29411.108\n */\n constructor(\n public readonly version: string,\n public readonly installationPath: string,\n public readonly installationVersion: string,\n ) {}\n\n /**\n * @returns directory where x86 msbuild can be found\n */\n msbuildPath() {\n return path.join(this.installationPath, 'MSBuild/Current/Bin');\n }\n\n cleanProject(slnFile: string) {\n const cmd = `\"${path.join(\n this.msbuildPath(),\n 'msbuild.exe',\n )}\" \"${slnFile}\" /t:Clean`;\n const results = child_process\n .execSync(cmd)\n .toString()\n .split(EOL);\n results.forEach(result => console.log(chalk.white(result)));\n }\n\n async buildProject(\n slnFile: string,\n buildType: BuildConfig,\n buildArch: BuildArch,\n msBuildProps: Record<string, string>,\n verbose: boolean,\n target: 'build' | 'deploy',\n buildLogDirectory: string | undefined,\n singleproc?: boolean,\n ) {\n newSuccess(`Found Solution: ${slnFile}`);\n newInfo(`Build configuration: ${buildType}`);\n newInfo(`Build platform: ${buildArch}`);\n\n const verbosityOption = verbose ? 'normal' : 'minimal';\n const logPrefix = path.join(\n buildLogDirectory || os.tmpdir(),\n `msbuild_${process.pid}_${target}`,\n );\n\n const errorLog = logPrefix + '.err';\n const warnLog = logPrefix + '.wrn';\n\n const localBinLog = target === 'build' ? '' : ':deploy.binlog';\n const binlog = buildLogDirectory ? `:${logPrefix}.binlog` : localBinLog;\n\n const args = [\n `/clp:NoSummary;NoItemAndPropertyList;Verbosity=${verbosityOption}`,\n '/nologo',\n `/p:Configuration=${buildType}`,\n `/p:Platform=${buildArch}`,\n '/p:AppxBundle=Never',\n `/bl${binlog}`,\n `/flp1:errorsonly;logfile=${errorLog}`,\n `/flp2:warningsonly;logfile=${warnLog}`,\n ];\n\n // Building projects in parallel increases compiler memory usage and\n // doesn't lead to dramatic performance gains (See #4739). Only enable\n // parallel builds on machines with >16GB of memory to avoid OOM errors\n const highMemory = totalmem() > 16 * 1024 * 1024 * 1024;\n const enableParallelBuilds = singleproc === false || highMemory;\n\n if (enableParallelBuilds) {\n args.push('/maxCpuCount');\n }\n\n if (target === 'build') {\n args.push('/restore', '/p:RestorePackagesConfig=true');\n } else {\n args.push(`/t:Deploy`);\n }\n\n Object.keys(msBuildProps).forEach(key => {\n args.push(`/p:${key}=${msBuildProps[key]}`);\n });\n\n try {\n checkRequirements.isWinSdkPresent('10.0');\n } catch (e) {\n newError((e as Error).message);\n throw e;\n }\n\n if (verbose) {\n console.log(`Running MSBuild with args ${args.join(' ')}`);\n }\n\n const progressName =\n target === 'deploy' ? 'Deploying Solution' : 'Building Solution';\n const spinner = newSpinner(progressName);\n try {\n await commandWithProgress(\n spinner,\n progressName,\n path.join(this.msbuildPath(), 'msbuild.exe'),\n [slnFile].concat(args),\n verbose,\n 'MSBuildError',\n );\n } catch (e) {\n let error = e;\n if (!e) {\n const firstMessage = (await fs.readFile(errorLog))\n .toString()\n .split(EOL)[0];\n error = new CodedError('MSBuildError', firstMessage);\n (error as any).logfile = errorLog;\n }\n throw error;\n }\n // If we have no errors, delete the error log when we're done\n if ((await fs.stat(errorLog)).size === 0) {\n await fs.unlink(errorLog);\n }\n }\n\n static findAvailableVersion(\n buildArch: BuildArch,\n verbose: boolean,\n prerelease?: boolean,\n ): MSBuildTools {\n // https://aka.ms/vs/workloads\n const requires = [\n 'Microsoft.Component.MSBuild',\n getVCToolsByArch(buildArch),\n ];\n const minVersion = process.env.VisualStudioVersion || '16.7';\n const vsInstallation = findLatestVsInstall({\n requires,\n minVersion,\n verbose,\n prerelease,\n });\n\n if (!vsInstallation) {\n if (process.env.VisualStudioVersion != null) {\n throw new CodedError(\n 'NoMSBuild',\n `MSBuild tools not found for version ${process.env.VisualStudioVersion} (from environment). Make sure all required components have been installed`,\n {VisualStudioVersionFromEnv: process.env.VisualStudioVersion},\n );\n } else {\n throw new CodedError(\n 'NoMSBuild',\n `Could not find MSBuild with VCTools for Visual Studio ${minVersion} or later. Make sure all required components have been installed`,\n {minVersion: minVersion},\n );\n }\n }\n\n const toolsPath = path.join(\n vsInstallation.installationPath,\n 'MSBuild/Current/Bin',\n );\n\n if (fs.existsSync(toolsPath)) {\n newSuccess(\n `Found compatible MSBuild at ${toolsPath} (${vsInstallation.installationVersion})`,\n );\n return new MSBuildTools(\n minVersion,\n vsInstallation.installationPath,\n vsInstallation.installationVersion,\n );\n } else {\n throw new CodedError(\n 'NoMSBuild',\n `MSBuild path '${toolsPath} does not exist'`,\n );\n }\n }\n\n static getAllAvailableUAPVersions(): Version[] {\n const results: Version[] = [];\n\n const programFilesFolder =\n process.env['ProgramFiles(x86)'] || process.env.ProgramFiles;\n // No Program Files folder found, so we won't be able to find UAP SDK\n if (!programFilesFolder) {\n return results;\n }\n\n let uapFolderPath = path.join(\n programFilesFolder,\n 'Windows Kits',\n '10',\n 'Platforms',\n 'UAP',\n );\n\n if (!shell.test('-e', uapFolderPath)) {\n // Check other installation folder from reg\n const sdkFolder = getSDK10InstallationFolder();\n if (sdkFolder) {\n uapFolderPath = path.join(sdkFolder, 'Platforms', 'UAP');\n }\n }\n\n // No UAP SDK exists on this machine\n if (!shell.test('-e', uapFolderPath)) {\n return results;\n }\n\n shell\n .ls(uapFolderPath)\n .filter(uapDir => shell.test('-d', path.join(uapFolderPath, uapDir)))\n .map(Version.tryParse)\n .forEach(version => version && results.push(version));\n\n return results;\n }\n}\n\nfunction getVCToolsByArch(buildArch: BuildArch): string {\n switch (buildArch) {\n case 'x86':\n case 'x64':\n return 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64';\n case 'ARM64':\n return 'Microsoft.VisualStudio.Component.VC.Tools.ARM64';\n }\n}\n\nfunction getSDK10InstallationFolder(): string {\n const folder = '';\n\n const execString =\n 'reg query \"HKLM\\\\SOFTWARE\\\\Microsoft\\\\Microsoft SDKs\\\\Windows\\\\v10.0\" /s /v InstallationFolder /reg:32';\n let output;\n try {\n output = execSync(execString).toString();\n } catch (e) {\n return folder;\n }\n\n const re = /\\\\Microsoft SDKs\\\\Windows\\\\v10.0\\s*InstallationFolder\\s+REG_SZ\\s+(.*)/gim;\n const match = re.exec(output);\n if (match) {\n return match[1];\n }\n\n return folder;\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
* @format
|
|
5
|
+
*/
|
|
6
|
+
import { Config, CommandOption } from '@react-native-community/cli-types';
|
|
7
|
+
import { CommanderOptionsType, OptionSanitizer } from '@react-native-windows/telemetry';
|
|
8
|
+
/**
|
|
9
|
+
* Calculates a the default values of a given react-native CLI command's options.
|
|
10
|
+
* @param config Config passed from react-native CLI.
|
|
11
|
+
* @param commandOptions The options definition for the command.
|
|
12
|
+
* @returns The default options for the command.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getDefaultOptions(config: Config, commandOptions: CommandOption[]): CommanderOptionsType;
|
|
15
|
+
/**
|
|
16
|
+
* Sets up and starts the telemetry gathering for the CLI command.
|
|
17
|
+
* @param commandName The name of the CLI command.
|
|
18
|
+
* @param config Config passed from react-native CLI.
|
|
19
|
+
* @param options Options passed from react-native CLI.
|
|
20
|
+
* @param defaultOptions Default options for the command.
|
|
21
|
+
* @param optionSanitizer Function to sanitize the option values for telemetry.
|
|
22
|
+
*/
|
|
23
|
+
export declare function startTelemetrySession(commandName: string, config: Config, options: CommanderOptionsType, defaultOptions: CommanderOptionsType, optionSanitizer: OptionSanitizer): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Ends the gathering of telemetry for the CLI command.
|
|
26
|
+
* @param error The error (if any) thrown during the command.
|
|
27
|
+
* @param getExtraProps Function to get any extra command-specific telemetry properties.
|
|
28
|
+
*/
|
|
29
|
+
export declare function endTelemetrySession(error?: Error, getExtraProps?: () => Promise<Record<string, any>>): Promise<void>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Microsoft Corporation.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
* @format
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.endTelemetrySession = exports.startTelemetrySession = exports.getDefaultOptions = void 0;
|
|
9
|
+
const lodash_1 = require("lodash");
|
|
10
|
+
const telemetry_1 = require("@react-native-windows/telemetry");
|
|
11
|
+
/**
|
|
12
|
+
* Calculates a the default values of a given react-native CLI command's options.
|
|
13
|
+
* @param config Config passed from react-native CLI.
|
|
14
|
+
* @param commandOptions The options definition for the command.
|
|
15
|
+
* @returns The default options for the command.
|
|
16
|
+
*/
|
|
17
|
+
function getDefaultOptions(config, commandOptions) {
|
|
18
|
+
const result = {
|
|
19
|
+
logging: false,
|
|
20
|
+
};
|
|
21
|
+
for (const option of commandOptions) {
|
|
22
|
+
let key = option.name.startsWith('--')
|
|
23
|
+
? option.name.slice('--'.length)
|
|
24
|
+
: option.name;
|
|
25
|
+
key = key.trim();
|
|
26
|
+
let value = option.default;
|
|
27
|
+
if (value !== undefined && value.name) {
|
|
28
|
+
value = value(config);
|
|
29
|
+
}
|
|
30
|
+
if (key.endsWith(' [string]')) {
|
|
31
|
+
// Option is a string
|
|
32
|
+
key = key.slice(0, -' [string]'.length);
|
|
33
|
+
// Option is a number
|
|
34
|
+
}
|
|
35
|
+
else if (key.endsWith(' [number]')) {
|
|
36
|
+
key = key.slice(0, -' [number]'.length);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// Option is a boolean
|
|
40
|
+
// Note: Commander ignores the default property for booleans
|
|
41
|
+
if (key.startsWith('no-')) {
|
|
42
|
+
key = key.slice('no-'.length);
|
|
43
|
+
// Commander always defaults to true for flags that start with --no
|
|
44
|
+
value = true;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
// Commander always defaults to undefined for flags
|
|
48
|
+
value = undefined;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
key = (0, lodash_1.camelCase)(key);
|
|
52
|
+
result[key] = value;
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
exports.getDefaultOptions = getDefaultOptions;
|
|
57
|
+
/**
|
|
58
|
+
* Sets up and starts the telemetry gathering for the CLI command.
|
|
59
|
+
* @param commandName The name of the CLI command.
|
|
60
|
+
* @param config Config passed from react-native CLI.
|
|
61
|
+
* @param options Options passed from react-native CLI.
|
|
62
|
+
* @param defaultOptions Default options for the command.
|
|
63
|
+
* @param optionSanitizer Function to sanitize the option values for telemetry.
|
|
64
|
+
*/
|
|
65
|
+
async function startTelemetrySession(commandName, config, options, defaultOptions, optionSanitizer) {
|
|
66
|
+
if (!options.telemetry) {
|
|
67
|
+
if (options.logging) {
|
|
68
|
+
console.log('Telemetry is disabled');
|
|
69
|
+
}
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
await telemetry_1.Telemetry.setup();
|
|
73
|
+
const sanitizedOptions = (0, telemetry_1.commanderOptionsToOptions)(options, optionSanitizer);
|
|
74
|
+
const sanitizedDefaultOptions = (0, telemetry_1.commanderOptionsToOptions)(defaultOptions, optionSanitizer);
|
|
75
|
+
const sanitizedArgs = (0, telemetry_1.optionsToArgs)(sanitizedOptions, process.argv);
|
|
76
|
+
const startInfo = {
|
|
77
|
+
commandName,
|
|
78
|
+
args: sanitizedArgs,
|
|
79
|
+
options: sanitizedOptions,
|
|
80
|
+
defaultOptions: sanitizedDefaultOptions,
|
|
81
|
+
};
|
|
82
|
+
telemetry_1.Telemetry.startCommand(startInfo);
|
|
83
|
+
const projectInfo = await (0, telemetry_1.configToProjectInfo)(config);
|
|
84
|
+
if (projectInfo) {
|
|
85
|
+
telemetry_1.Telemetry.setProjectInfo(projectInfo);
|
|
86
|
+
}
|
|
87
|
+
const projectFile = (0, telemetry_1.getProjectFileFromConfig)(config);
|
|
88
|
+
if (projectFile) {
|
|
89
|
+
await telemetry_1.Telemetry.populateNuGetPackageVersions(projectFile);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.startTelemetrySession = startTelemetrySession;
|
|
93
|
+
/**
|
|
94
|
+
* Ends the gathering of telemetry for the CLI command.
|
|
95
|
+
* @param error The error (if any) thrown during the command.
|
|
96
|
+
* @param getExtraProps Function to get any extra command-specific telemetry properties.
|
|
97
|
+
*/
|
|
98
|
+
async function endTelemetrySession(error, getExtraProps) {
|
|
99
|
+
const endInfo = {
|
|
100
|
+
resultCode: 'Success',
|
|
101
|
+
};
|
|
102
|
+
if (error) {
|
|
103
|
+
endInfo.resultCode =
|
|
104
|
+
error instanceof telemetry_1.CodedError ? error.type : 'Unknown';
|
|
105
|
+
}
|
|
106
|
+
telemetry_1.Telemetry.endCommand(endInfo, getExtraProps ? await getExtraProps() : undefined);
|
|
107
|
+
}
|
|
108
|
+
exports.endTelemetrySession = endTelemetrySession;
|
|
109
|
+
//# sourceMappingURL=telemetryHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetryHelpers.js","sourceRoot":"","sources":["../../../src/runWindows/utils/telemetryHelpers.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,mCAAiC;AAQjC,+DAWyC;AAEzC;;;;;GAKG;AACH,SAAgB,iB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S;KACtB,CAAC;IAEF,IAAI,KAAK,EAAE;QACT,OAAO,CAAC,UAAU;YAChB,KAAK,YAAY,sBAAU,CAAC,CAAC,CAAE,KAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;KACxE;IAED,qBAAS,CAAC,UAAU,CAClB,OAAO,EACP,aAAa,CAAC,CAAC,CAAC,MAAM,aAAa,EAAE,CAAC,CAAC,CAAC,SAAS,CAClD,CAAC;AACJ,CAAC;AAjBD,kDAiBC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport {camelCase} from 'lodash';\n\nimport {\n Config,\n CommandOption,\n OptionValue,\n} from '@react-native-community/cli-types';\n\nimport {\n Telemetry,\n CodedError,\n CommandStartInfo,\n CommandEndInfo,\n CommanderOptionsType,\n commanderOptionsToOptions,\n optionsToArgs,\n OptionSanitizer,\n configToProjectInfo,\n getProjectFileFromConfig,\n} from '@react-native-windows/telemetry';\n\n/**\n * Calculates a the default values of a given react-native CLI command's options.\n * @param config Config passed from react-native CLI.\n * @param commandOptions The options definition for the command.\n * @returns The default options for the command.\n */\nexport function getDefaultOptions(\n config: Config,\n commandOptions: CommandOption[],\n): CommanderOptionsType {\n const result: CommanderOptionsType = {\n logging: false,\n };\n for (const option of commandOptions) {\n let key = option.name.startsWith('--')\n ? option.name.slice('--'.length)\n : option.name;\n key = key.trim();\n\n let value = option.default;\n if (value !== undefined && (value as (ctx: Config) => OptionValue).name) {\n value = (value as (ctx: Config) => OptionValue)(config);\n }\n\n if (key.endsWith(' [string]')) {\n // Option is a string\n key = key.slice(0, -' [string]'.length);\n // Option is a number\n } else if (key.endsWith(' [number]')) {\n key = key.slice(0, -' [number]'.length);\n } else {\n // Option is a boolean\n // Note: Commander ignores the default property for booleans\n if (key.startsWith('no-')) {\n key = key.slice('no-'.length);\n // Commander always defaults to true for flags that start with --no\n value = true;\n } else {\n // Commander always defaults to undefined for flags\n value = undefined;\n }\n }\n\n key = camelCase(key);\n result[key] = value;\n }\n return result;\n}\n\n/**\n * Sets up and starts the telemetry gathering for the CLI command.\n * @param commandName The name of the CLI command.\n * @param config Config passed from react-native CLI.\n * @param options Options passed from react-native CLI.\n * @param defaultOptions Default options for the command.\n * @param optionSanitizer Function to sanitize the option values for telemetry.\n */\nexport async function startTelemetrySession(\n commandName: string,\n config: Config,\n options: CommanderOptionsType,\n defaultOptions: CommanderOptionsType,\n optionSanitizer: OptionSanitizer,\n) {\n if (!options.telemetry) {\n if (options.logging) {\n console.log('Telemetry is disabled');\n }\n return;\n }\n\n await Telemetry.setup();\n\n const sanitizedOptions = commanderOptionsToOptions(options, optionSanitizer);\n const sanitizedDefaultOptions = commanderOptionsToOptions(\n defaultOptions,\n optionSanitizer,\n );\n const sanitizedArgs = optionsToArgs(sanitizedOptions, process.argv);\n\n const startInfo: CommandStartInfo = {\n commandName,\n args: sanitizedArgs,\n options: sanitizedOptions,\n defaultOptions: sanitizedDefaultOptions,\n };\n\n Telemetry.startCommand(startInfo);\n\n const projectInfo = await configToProjectInfo(config);\n if (projectInfo) {\n Telemetry.setProjectInfo(projectInfo);\n }\n\n const projectFile = getProjectFileFromConfig(config);\n if (projectFile) {\n await Telemetry.populateNuGetPackageVersions(projectFile);\n }\n}\n\n/**\n * Ends the gathering of telemetry for the CLI command.\n * @param error The error (if any) thrown during the command.\n * @param getExtraProps Function to get any extra command-specific telemetry properties.\n */\nexport async function endTelemetrySession(\n error?: Error,\n getExtraProps?: () => Promise<Record<string, any>>,\n) {\n const endInfo: CommandEndInfo = {\n resultCode: 'Success',\n };\n\n if (error) {\n endInfo.resultCode =\n error instanceof CodedError ? (error as CodedError).type : 'Unknown';\n }\n\n Telemetry.endCommand(\n endInfo,\n getExtraProps ? await getExtraProps() : undefined,\n );\n}\n"]}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* @format
|
|
5
5
|
*/
|
|
6
6
|
export default class Version {
|
|
7
|
-
private major;
|
|
8
|
-
private minor;
|
|
9
|
-
private build;
|
|
10
|
-
private qfe;
|
|
7
|
+
private readonly major;
|
|
8
|
+
private readonly minor;
|
|
9
|
+
private readonly build;
|
|
10
|
+
private readonly qfe;
|
|
11
11
|
constructor(major: number, minor?: number, build?: number, qfe?: number);
|
|
12
12
|
eq(other: Version): boolean;
|
|
13
13
|
gt(other: Version): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/runWindows/utils/version.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAEH,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AAEvD,MAAqB,OAAO;IAC1B,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/runWindows/utils/version.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAEH,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AAEvD,MAAqB,OAAO;IAC1B,YACmB,KAAa,EACb,QAAgB,CAAC,EACjB,QAAgB,CAAC,EACjB,MAAc,CAAC;QAHf,UAAK,GAAL,KAAK,CAAQ;QACb,UAAK,GAAL,KAAK,CAAY;QACjB,UAAK,GAAL,KAAK,CAAY;QACjB,QAAG,GAAH,GAAG,CAAY;IAC/B,CAAC;IAEJ,EAAE,CAAC,KAAc;QACf,IAAI,KAAK,CAAC,WAAW,KAAK,OAAO,EAAE;YACjC,MAAM,IAAI,SAAS,CAAC,kCAAkC,CAAC,CAAC;SACzD;QAED,OAAO,CACL,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK;YAC1B,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK;YAC1B,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK;YAC1B,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,CACvB,CAAC;IACJ,CAAC;IAED,EAAE,CAAC,KAAc;QACf,IAAI,KAAK,CAAC,WAAW,KAAK,OAAO,EAAE;YACjC,MAAM,IAAI,SAAS,CAAC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AAI,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAChC,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;YAC9D,OAAO,IAAI,OAAO,CAChB,YAAY,CAAC,CAAC,CAAC,EACf,YAAY,CAAC,CAAC,CAAC,EACf,YAAY,CAAC,CAAC,CAAC,EACf,YAAY,CAAC,CAAC,CAAC,CAChB,CAAC;SACH;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAvHD,0BAuHC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nconst VERSION_EXPRESSION = /^\\d{1,8}(\\.\\d{1,8}){0,3}$/;\n\nexport default class Version {\n constructor(\n private readonly major: number,\n private readonly minor: number = 0,\n private readonly build: number = 0,\n private readonly qfe: number = 0,\n ) {}\n\n eq(other: Version): boolean {\n if (other.constructor !== Version) {\n throw new TypeError('other must be a Version instance');\n }\n\n return (\n this.major === other.major &&\n this.minor === other.minor &&\n this.build === other.build &&\n this.qfe === other.qfe\n );\n }\n\n gt(other: Version): boolean {\n if (other.constructor !== Version) {\n throw new TypeError('other must be a Version instance');\n }\n\n if (this.major > other.major) {\n return true;\n }\n if (this.major < other.major) {\n return false;\n }\n if (this.minor > other.minor) {\n return true;\n }\n if (this.minor < other.minor) {\n return false;\n }\n if (this.build > other.build) {\n return true;\n }\n if (this.build < other.build) {\n return false;\n }\n if (this.qfe > other.qfe) {\n return true;\n }\n if (this.qfe < other.qfe) {\n return false;\n }\n\n return false;\n }\n\n gte(other: Version): boolean {\n if (other.constructor !== Version) {\n throw new TypeError('other must be a Version instance');\n }\n\n if (this.major > other.major) {\n return true;\n }\n if (this.major < other.major) {\n return false;\n }\n if (this.minor > other.minor) {\n return true;\n }\n if (this.minor < other.minor) {\n return false;\n }\n if (this.build > other.build) {\n return true;\n }\n if (this.build < other.build) {\n return false;\n }\n if (this.qfe > other.qfe) {\n return true;\n }\n if (this.qfe < other.qfe) {\n return false;\n }\n\n return true;\n }\n\n toString(): string {\n return `${this.major}.${this.minor}.${this.build}.${this.qfe}`;\n }\n\n static compare(x: Version, y: Version): number {\n if (x.constructor !== Version || y.constructor !== Version) {\n throw new TypeError('Only can compare Version objects');\n }\n\n return x.gt(y) ? 1 : x.eq(y) ? 0 : -1;\n }\n\n static fromString(str: string): Version {\n const version = Version.tryParse(str);\n if (!version) {\n throw new TypeError('Cannot construct a version from \"' + str + '\".');\n }\n return version;\n }\n\n static tryParse(str: string): Version | null {\n if (VERSION_EXPRESSION.test(str)) {\n const versionArray = str.split('.').map(x => parseInt(x, 10));\n return new Version(\n versionArray[0],\n versionArray[1],\n versionArray[2],\n versionArray[3],\n );\n }\n return null;\n }\n}\n"]}
|
|
@@ -10,6 +10,7 @@ interface VisualStudioInstallation {
|
|
|
10
10
|
instanceId: string;
|
|
11
11
|
installationPath: string;
|
|
12
12
|
installationVersion: string;
|
|
13
|
+
prerelease: string;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Enumerate the installed versions of Visual Studio
|
|
@@ -19,13 +20,15 @@ export declare function enumerateVsInstalls(opts: {
|
|
|
19
20
|
version?: string;
|
|
20
21
|
verbose?: boolean;
|
|
21
22
|
latest?: boolean;
|
|
23
|
+
prerelease?: boolean;
|
|
22
24
|
}): VisualStudioInstallation[];
|
|
23
25
|
/**
|
|
24
26
|
* Find the latest available VS installation that matches the given constraints
|
|
25
27
|
*/
|
|
26
28
|
export declare function findLatestVsInstall(opts: {
|
|
27
29
|
requires?: string[];
|
|
28
|
-
|
|
30
|
+
minVersion?: string;
|
|
29
31
|
verbose?: boolean;
|
|
32
|
+
prerelease?: boolean;
|
|
30
33
|
}): VisualStudioInstallation | null;
|
|
31
34
|
export {};
|
|
@@ -4,11 +4,15 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
* @format
|
|
6
6
|
*/
|
|
7
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
+
};
|
|
7
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
11
|
exports.findLatestVsInstall = exports.enumerateVsInstalls = void 0;
|
|
12
|
+
const telemetry_1 = require("@react-native-windows/telemetry");
|
|
9
13
|
const child_process_1 = require("child_process");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
14
|
+
const fs_1 = __importDefault(require("@react-native-windows/fs"));
|
|
15
|
+
const path_1 = __importDefault(require("path"));
|
|
12
16
|
/**
|
|
13
17
|
* Helper to run vswhere in JSON mode
|
|
14
18
|
*
|
|
@@ -17,14 +21,19 @@ const path = require("path");
|
|
|
17
21
|
*/
|
|
18
22
|
function vsWhere(args, verbose) {
|
|
19
23
|
// This path is maintained and VS has promised to keep it valid.
|
|
20
|
-
const vsWherePath =
|
|
24
|
+
const vsWherePath = path_1.default.join(process.env['ProgramFiles(x86)'] || process.env.ProgramFiles, '/Microsoft Visual Studio/Installer/vswhere.exe');
|
|
21
25
|
if (verbose) {
|
|
22
26
|
console.log('Looking for vswhere at: ' + vsWherePath);
|
|
23
27
|
}
|
|
24
|
-
if (!
|
|
25
|
-
throw new
|
|
28
|
+
if (!fs_1.default.existsSync(vsWherePath)) {
|
|
29
|
+
throw new telemetry_1.CodedError('NoVSWhere', `Unable to find vswhere at ${vsWherePath}`);
|
|
26
30
|
}
|
|
27
|
-
|
|
31
|
+
const cmdline = `"${vsWherePath}" ${args.join(' ')} -format json -utf8`;
|
|
32
|
+
const json = JSON.parse((0, child_process_1.execSync)(cmdline).toString('utf8'));
|
|
33
|
+
for (const entry of json) {
|
|
34
|
+
entry.prerelease = entry.catalog.productMilestoneIsPreRelease;
|
|
35
|
+
}
|
|
36
|
+
return json;
|
|
28
37
|
}
|
|
29
38
|
/**
|
|
30
39
|
* Enumerate the installed versions of Visual Studio
|
|
@@ -40,6 +49,9 @@ function enumerateVsInstalls(opts) {
|
|
|
40
49
|
if (opts.latest) {
|
|
41
50
|
args.push('-latest');
|
|
42
51
|
}
|
|
52
|
+
if (opts.prerelease) {
|
|
53
|
+
args.push('-prerelease');
|
|
54
|
+
}
|
|
43
55
|
return vsWhere(args, opts.verbose);
|
|
44
56
|
}
|
|
45
57
|
exports.enumerateVsInstalls = enumerateVsInstalls;
|
|
@@ -47,7 +59,10 @@ exports.enumerateVsInstalls = enumerateVsInstalls;
|
|
|
47
59
|
* Find the latest available VS installation that matches the given constraints
|
|
48
60
|
*/
|
|
49
61
|
function findLatestVsInstall(opts) {
|
|
50
|
-
|
|
62
|
+
let installs = enumerateVsInstalls({ ...opts, latest: true });
|
|
63
|
+
if (opts.prerelease && installs.length > 0) {
|
|
64
|
+
installs = installs.filter(x => x.prerelease === 'True');
|
|
65
|
+
}
|
|
51
66
|
if (installs.length > 0) {
|
|
52
67
|
return installs[0];
|
|
53
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vsInstalls.js","sourceRoot":"","sources":["../../../src/runWindows/utils/vsInstalls.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"vsInstalls.js","sourceRoot":"","sources":["../../../src/runWindows/utils/vsInstalls.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,+DAA2D;AAC3D,iDAAuC;AACvC,kEAA0C;AAC1C,gDAAwB;AAYxB;;;;;GAKG;AACH,SAAS,OAAO,CAAC,IAAc,EAAE,OAAiB;IAChD,gEAAgE;IAChE,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAC3B,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,YAAa,EAC7D,gDAAgD,CACjD,CAAC;IAEF,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,0BAA0B,GAAG,WAAW,CA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KnC;IACC,IAAI,QAAQ,GAAG,mBAAmB,CAAC,EAAC,GAAG,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;IAE5D,IAAI,IAAI,CAAC,UAAU,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QAC1C,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,MAAM,CAAC,CAAC;KAC1D;IAED,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QACvB,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;KACpB;SAAM;QACL,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AAjBD,kDAiBC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport {CodedError} from '@react-native-windows/telemetry';\nimport {execSync} from 'child_process';\nimport fs from '@react-native-windows/fs';\nimport path from 'path';\n\n/**\n * A subset of the per-instance properties returned by vswhere\n */\ninterface VisualStudioInstallation {\n instanceId: string;\n installationPath: string;\n installationVersion: string;\n prerelease: string;\n}\n\n/**\n * Helper to run vswhere in JSON mode\n *\n * @param args Arguments to pass to vsWhere\n * @param verbose enable verbose logging\n */\nfunction vsWhere(args: string[], verbose?: boolean): any[] {\n // This path is maintained and VS has promised to keep it valid.\n const vsWherePath = path.join(\n process.env['ProgramFiles(x86)'] || process.env.ProgramFiles!,\n '/Microsoft Visual Studio/Installer/vswhere.exe',\n );\n\n if (verbose) {\n console.log('Looking for vswhere at: ' + vsWherePath);\n }\n\n if (!fs.existsSync(vsWherePath)) {\n throw new CodedError(\n 'NoVSWhere',\n `Unable to find vswhere at ${vsWherePath}`,\n );\n }\n\n const cmdline = `\"${vsWherePath}\" ${args.join(' ')} -format json -utf8`;\n const json = JSON.parse(execSync(cmdline).toString('utf8'));\n\n for (const entry of json) {\n entry.prerelease = entry.catalog.productMilestoneIsPreRelease;\n }\n\n return json;\n}\n\n/**\n * Enumerate the installed versions of Visual Studio\n */\nexport function enumerateVsInstalls(opts: {\n requires?: string[];\n version?: string;\n verbose?: boolean;\n latest?: boolean;\n prerelease?: boolean;\n}): VisualStudioInstallation[] {\n const args: string[] = [];\n\n if (opts.version) {\n args.push(`-version [${opts.version},${Number(opts.version) + 1})`);\n }\n\n if (opts.requires) {\n args.push(`-requires ${opts.requires.join(' ')}`);\n }\n\n if (opts.latest) {\n args.push('-latest');\n }\n\n if (opts.prerelease) {\n args.push('-prerelease');\n }\n\n return vsWhere(args, opts.verbose);\n}\n\n/**\n * Find the latest available VS installation that matches the given constraints\n */\nexport function findLatestVsInstall(opts: {\n requires?: string[];\n minVersion?: string;\n verbose?: boolean;\n prerelease?: boolean;\n}): VisualStudioInstallation | null {\n let installs = enumerateVsInstalls({...opts, latest: true});\n\n if (opts.prerelease && installs.length > 0) {\n installs = installs.filter(x => x.prerelease === 'True');\n }\n\n if (installs.length > 0) {\n return installs[0];\n } else {\n return null;\n }\n}\n"]}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @format
|
|
5
5
|
*/
|
|
6
6
|
import { Project } from '../../config/projectConfig';
|
|
7
|
+
export declare const dotNetCoreProjectTypeGuid = "{9A19103F-16F7-4668-BE54-9A1E7A4F7556}";
|
|
7
8
|
/**
|
|
8
9
|
* Adds the necessary info from a VS project into a VS solution file so that it will build.
|
|
9
10
|
* @param slnFile The Absolute path to the target VS solution file.
|