X Tutup
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ Karma is run against the new output.
much easier to debug. `xit` and `xdescribe` can also be useful to exclude a test and a group of
tests respectively.

**Note**: **watch mode** needs symlinks to work, so if you're using windows, ensure you have the
rights to built them in your operating system.

### E2E tests

1. `$(npm bin)/gulp build.js.cjs` (builds benchpress and tests into `dist/js/cjs` folder).
Expand Down
6 changes: 5 additions & 1 deletion tools/broccoli/broccoli-replace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ class DiffingReplace implements DiffingBroccoliPlugin {
});
fs.writeFileSync(destFilePath, content, FILE_ENCODING);
} else if (!fs.existsSync(destFilePath)) {
fs.symlinkSync(sourceFilePath, destFilePath);
try {
fs.symlinkSync(sourceFilePath, destFilePath);
} catch (e) {
fs.writeFileSync(destFilePath, fs.readFileSync(sourceFilePath));
}
}
});

Expand Down
26 changes: 24 additions & 2 deletions tools/build/linknodemodules.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,34 @@ module.exports = function(gulp, plugins, config) {
var linkDir = path.join(nodeModulesDir, relativeFolder);
if (!fs.existsSync(linkDir)) {
console.log('creating link', linkDir, sourceDir);
fs.symlinkSync(sourceDir, linkDir, 'dir');
try {
fs.symlinkSync(sourceDir, linkDir, 'dir');
}
catch(e) {
var sourceDir = path.join(config.dir, relativeFolder);
console.log('linking failed: trying to hard copy', linkDir, sourceDir);
copyRecursiveSync(sourceDir, linkDir);
}
}
});
};
};

function copyRecursiveSync (src, dest) {
if (fs.existsSync(src)) {
var stats = fs.statSync(src);
if (stats.isDirectory()) {
fs.mkdirSync(dest);
fs.readdirSync(src).forEach(function(childItemName) {
copyRecursiveSync(path.join(src, childItemName),
path.join(dest, childItemName));
});
} else {
fs.writeFileSync(dest, fs.readFileSync(src));
}
}
}

function getSubdirs(rootDir) {
return fs.readdirSync(rootDir).filter(function(file) {
if (file[0] === '.') {
Expand All @@ -29,4 +51,4 @@ function getSubdirs(rootDir) {
var dirPath = path.join(rootDir, file);
return fs.statSync(dirPath).isDirectory();
});
}
}
X Tutup