Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit e5c68db

Browse files
authored
Merge pull request #870 from jianjunz/flags-for-quic
Add flags to enable QUIC agent.
2 parents 88dfc7f + 96e1be6 commit e5c68db

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

scripts/pack.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ optParser.addOption('r', 'repack', 'boolean', 'Whether clean dist before pack (E
1919
optParser.addOption('e', 'encrypt', 'boolean', 'Whether encrypt during pack (Eg. pack.js -t portal -e)');
2020
optParser.addOption('d', 'debug', 'boolean', '(Disabled)');
2121
optParser.addOption('o', 'addon-debug', 'boolean', 'Whether pack debug addon (Eg. pack.js -t webrtc-agent -o)');
22-
optParser.addOption('f', 'full', 'boolean', 'Whether perform a full pack (--full is the equalivation of pack.js -t all -r -i)');
22+
optParser.addOption('f', 'full', 'boolean', 'Whether perform a full pack (--full is the equalivation of pack.js -t all -r -i). Experimental features are not included, please include them explicitly with -t.');
2323
optParser.addOption('p', 'app-path', 'string', 'Specify app path (Eg. pack.js -t all --app-path ${appPath})');
2424
optParser.addOption('a', 'archive', 'string', 'Specify archive name (Eg. pack.js -t all -a ${archiveName})');
2525
optParser.addOption('n', 'node-module-path', 'string', 'Specify shared-node-module directory');
@@ -45,7 +45,10 @@ const experimentalTargets = ['quic-agent'];
4545
var allTargets = [];
4646

4747
if (options.full) {
48-
options.target = ['all'];
48+
if (!options.target) {
49+
options.target = [];
50+
}
51+
options.target.push('all');
4952
options.repack = true;
5053
options['install-module'] = true;
5154
}
@@ -119,7 +122,11 @@ function getPackList(targets) {
119122
console.log('Avalible Targets Are:');
120123
console.log('---------------------');
121124
for (const target of targets) {
122-
console.log(`\x1b[32m${target.rules.name}\x1b[0m`);
125+
let targetTitle = `\x1b[32m${target.rules.name}\x1b[0m`;
126+
if (experimentalTargets.includes(target.rules.name)) {
127+
targetTitle += ' (experimental feature)'
128+
}
129+
console.log(targetTitle);
123130
console.log(' ->', target.path);
124131
}
125132
process.exit(0);
@@ -130,7 +137,7 @@ function getPackList(targets) {
130137
}
131138

132139
var packList = targets.filter((element) => {
133-
// Don't include QUIC agent by default until CI is added for QUIC SDK.
140+
// Experimental features are not included by default.
134141
if (options.target.includes('all') && !experimentalTargets.includes(element.rules.name)) return true;
135142
return options.target.includes(element.rules.name);
136143
});
@@ -592,7 +599,7 @@ function packScripts() {
592599
}
593600
scriptItems.push('app');
594601
scriptItems.forEach((m) => {
595-
if (experimentalTargets.includes(m)) {
602+
if (!options.target.includes(m) && experimentalTargets.includes(m)) {
596603
return;
597604
}
598605
startCommands += '${bin}/daemon.sh start ' + m + ' $1\n';

0 commit comments

Comments
 (0)