Skip to content

Commit 3b41b5a

Browse files
Merge pull request #3919 from NativeScript/vladimirov/remove-submodule
chore: remove submodule
2 parents eb79a1e + d145c6e commit 3b41b5a

File tree

297 files changed

+78482
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

297 files changed

+78482
-6
lines changed

.gitignore

+40-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,43 @@ node_modules
3939
docs/html
4040
docs-cli
4141

42-
!test-scripts/*.js
42+
!test-scripts/*.js
43+
44+
# From previous submodule
45+
lib/common/*.js
46+
lib/common/!vendor/*.json
47+
48+
lib/common/*.js.map
49+
!lib/common/vendor/*.js
50+
51+
lib/common/lib-cov
52+
lib/common/*.seed
53+
lib/common/*.log
54+
lib/common/*.csv
55+
lib/common/*.dat
56+
lib/common/*.out
57+
lib/common/*.pid
58+
lib/common/*.gz
59+
lib/common/*.tgz
60+
lib/common/*.tmp
61+
lib/common/*.sublime-workspace
62+
lib/common/tscommand*.tmp.txt
63+
lib/common/.tscache/
64+
lib/common/pids
65+
lib/common/logs
66+
lib/common/results
67+
lib/common/scratch/
68+
lib/common/.idea/workspace.xml
69+
lib/common/.idea/tasks.xml
70+
lib/common/.idea/watcherTasks.xml
71+
72+
lib/common/npm-debug.log
73+
lib/common/node_modules
74+
!lib/common/Gruntfile.js
75+
lib/common/.d.ts
76+
!lib/common/bin/**/*
77+
lib/common/coverage/**/*
78+
lib/common/xunit.xml
79+
lib/common/test-reports.xml
80+
!lib/common/test-scripts/**
81+
!lib/common/scripts/**

.gitmodules

-3
This file was deleted.

lib/common

-1
This file was deleted.

lib/common/.gitignore

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
*.js
2+
!vendor/*.js
3+
4+
*.js.map
5+
!vendor/*.js
6+
7+
lib-cov
8+
*.seed
9+
*.log
10+
*.csv
11+
*.dat
12+
*.out
13+
*.pid
14+
*.gz
15+
*.tgz
16+
*.tmp
17+
*.sublime-workspace
18+
tscommand*.tmp.txt
19+
.tscache/
20+
21+
pids
22+
logs
23+
results
24+
scratch/
25+
.idea/workspace.xml
26+
.idea/tasks.xml
27+
.idea/watcherTasks.xml
28+
29+
npm-debug.log
30+
node_modules
31+
!Gruntfile.js
32+
.d.ts
33+
!bin/**/*
34+
coverage/**/*
35+
xunit.xml
36+
test-reports.xml
37+
!test-scripts/**
38+
!scripts/**

lib/common/.npmignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**/*.ts
2+
**/*.js.map
3+
coverage
4+
.tscache
5+
test-reports.xml
6+
*.tgz
7+
.vscode
8+
.npmignore
9+
test/**/*
10+
test-scripts/**/*
11+
lib/common/test/**/*
12+
lib/common/test-scripts/**/*

lib/common/.travis.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
branches:
2+
only:
3+
- master
4+
- release
5+
language: node_js
6+
node_js:
7+
- '6'
8+
install:
9+
- npm install --ignore-scripts
10+
- npm install --save-dev grunt-cli
11+
script:
12+
- node_modules/.bin/grunt all

lib/common/.vscode/settings.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"files.exclude": {
4+
"**/.git": true,
5+
"**/.DS_Store": true,
6+
"**/*.js": { "when": "$(basename).ts"},
7+
"**/*.js.map": true
8+
}
9+
}

lib/common/Gruntfile.js

+179
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
const util = require("util");
2+
const os = require("os");
3+
const childProcess = require("child_process");
4+
5+
const now = new Date().toISOString();
6+
7+
function shallowCopy(obj) {
8+
var result = {};
9+
Object.keys(obj).forEach(function (key) {
10+
result[key] = obj[key];
11+
});
12+
return result;
13+
}
14+
15+
function getBuildVersion(version) {
16+
var buildVersion = version !== undefined ? version : process.env["BUILD_NUMBER"];
17+
if (process.env["BUILD_CAUSE_GHPRBCAUSE"]) {
18+
buildVersion = "PR" + buildVersion;
19+
}
20+
21+
return buildVersion;
22+
}
23+
24+
module.exports = function (grunt) {
25+
26+
// Windows cmd does not accept paths with / and unix shell does not accept paths with \\ and we need to execute from a sub-dir.
27+
// To circumvent the issue, hack our environment's PATH and let the OS deal with it, which in practice works
28+
process.env.path = process.env.path + (os.platform() === "win32" ? ";" : ":") + "node_modules/.bin";
29+
30+
var defaultEnvironment = "sit";
31+
32+
grunt.initConfig({
33+
jobName: process.env["JOB_NAME"] || defaultEnvironment,
34+
buildNumber: process.env["BUILD_NUMBER"] || "non-ci",
35+
dateString: now.substr(0, now.indexOf("T")),
36+
37+
pkg: grunt.file.readJSON("package.json"),
38+
39+
ts: {
40+
options: grunt.file.readJSON("tsconfig.json").compilerOptions,
41+
42+
devlib: {
43+
src: ["**/*.ts", "!node_modules/**/*.ts"],
44+
reference: ".d.ts"
45+
},
46+
47+
devall: {
48+
src: ["**/*.ts", "!node_modules/**/*.ts", "test/**/*.ts"],
49+
reference: ".d.ts"
50+
},
51+
52+
release_build: {
53+
src: ["**/*.ts", "!node_modules/**/*.ts", "test/**/*.ts"],
54+
reference: ".d.ts",
55+
options: {
56+
sourceMap: false,
57+
removeComments: true
58+
}
59+
}
60+
},
61+
62+
watch: {
63+
devall: {
64+
files: ["**/*.ts", "!node_modules/**/*.ts", 'test/**/*.ts'],
65+
tasks: ['ts:devall'],
66+
options: {
67+
atBegin: true,
68+
interrupt: true
69+
}
70+
}
71+
},
72+
73+
shell: {
74+
options: {
75+
stdout: true,
76+
stderr: true
77+
},
78+
79+
ci_unit_tests: {
80+
command: "npm test",
81+
options: {
82+
execOptions: {
83+
env: (function () {
84+
var env = shallowCopy(process.env);
85+
env["XUNIT_FILE"] = "test-reports.xml";
86+
env["LOG_XUNIT"] = "true";
87+
return env;
88+
})()
89+
}
90+
}
91+
},
92+
93+
build_package: {
94+
command: "npm pack",
95+
options: {
96+
execOptions: {
97+
env: (function () {
98+
var env = shallowCopy(process.env);
99+
env["COMMON_LIB_SKIP_POSTINSTALL_TASKS"] = "1";
100+
return env;
101+
})()
102+
}
103+
}
104+
}
105+
},
106+
107+
clean: {
108+
src: ["test/**/*.js*",
109+
"**/*.js*",
110+
"!**/*.json",
111+
"!Gruntfile.js",
112+
"!node_modules/**/*",
113+
"!bin/common-lib.js",
114+
"!vendor/*.js",
115+
"*.tgz",
116+
"!test-scripts/**/*",
117+
"!scripts/**/*"]
118+
}
119+
});
120+
121+
grunt.loadNpmTasks("grunt-contrib-clean");
122+
grunt.loadNpmTasks("grunt-contrib-watch");
123+
grunt.loadNpmTasks("grunt-shell");
124+
grunt.loadNpmTasks("grunt-ts");
125+
126+
grunt.registerTask("set_package_version", function (version) {
127+
var buildVersion = getBuildVersion(version);
128+
var packageJson = grunt.file.readJSON("package.json");
129+
packageJson.buildVersion = buildVersion;
130+
grunt.file.write("package.json", JSON.stringify(packageJson, null, " "));
131+
});
132+
133+
grunt.registerTask("tslint:build", function (version) {
134+
childProcess.execSync("npm run tslint", { stdio: "inherit" });
135+
});
136+
137+
grunt.registerTask("setPackageName", function (version) {
138+
var fs = require("fs");
139+
var fileExtension = ".tgz";
140+
var buildVersion = getBuildVersion(version);
141+
var packageJson = grunt.file.readJSON("package.json");
142+
var oldFileName = packageJson.name + "-" + packageJson.version + fileExtension;
143+
if (buildVersion) {
144+
var newFileName = oldFileName + "-" + buildVersion + fileExtension;
145+
fs.renameSync(oldFileName, newFileName);
146+
console.log("Renamed " + oldFileName + " to " + newFileName);
147+
} else {
148+
console.log("Packed file is: " + oldFileName);
149+
}
150+
});
151+
152+
grunt.registerTask("delete_coverage_dir", function () {
153+
var done = this.async();
154+
var rimraf = require("rimraf");
155+
rimraf("coverage", function (err) {
156+
if (err) {
157+
console.log("Error while deleting coverage directory from the package.");
158+
done(false);
159+
}
160+
161+
done();
162+
});
163+
});
164+
165+
grunt.registerTask("test", ["ts:devall", "shell:ci_unit_tests"]);
166+
grunt.registerTask("pack", [
167+
"tslint:build",
168+
"ts:release_build",
169+
"shell:ci_unit_tests",
170+
171+
"set_package_version",
172+
"delete_coverage_dir",
173+
"shell:build_package",
174+
"setPackageName"
175+
]);
176+
grunt.registerTask("lint", ["tslint:build"]);
177+
grunt.registerTask("default", "ts:devlib");
178+
grunt.registerTask("all", ["clean", "test", "lint"]);
179+
};

0 commit comments

Comments
 (0)