mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Add a build step / documentation for code reuse
Trac: 32499
This commit is contained in:
parent
3bdcc3408e
commit
af4cc52dc2
6 changed files with 75 additions and 13 deletions
|
|
@ -39,7 +39,10 @@ var SHARED_FILES = [
|
|||
];
|
||||
|
||||
var concatJS = function(outDir, init, outFile, pre) {
|
||||
var files = FILES.concat(`init-${init}.js`);
|
||||
var files = FILES;
|
||||
if (init) {
|
||||
files = files.concat(`init-${init}.js`);
|
||||
}
|
||||
var outPath = `${outDir}/${outFile}`;
|
||||
writeFileSync(outPath, pre, 'utf8');
|
||||
execSync(`cat ${files.join(' ')} >> ${outPath}`);
|
||||
|
|
@ -176,6 +179,11 @@ task('clean', 'remove all built files', function() {
|
|||
execSync('rm -rf build test spec/support');
|
||||
});
|
||||
|
||||
task('library', 'build the library', function() {
|
||||
concatJS('.', '', 'snowflake-library.js', '');
|
||||
console.log('Library prepared.');
|
||||
});
|
||||
|
||||
var cmd = process.argv[2];
|
||||
|
||||
if (tasks.has(cmd)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue