Added NightAlert project for travel kit
This commit is contained in:
71
ThirdParty/SocketIoClientDotNet/grunt/tasks/build-client.js
vendored
Normal file
71
ThirdParty/SocketIoClientDotNet/grunt/tasks/build-client.js
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
module.exports = function (grunt) {
|
||||
|
||||
grunt.registerTask('buildClient',
|
||||
'build cs modules', function () {
|
||||
var
|
||||
fs = require('fs'),
|
||||
S = require('string'),
|
||||
string = require('string-formatter'),
|
||||
os = grunt.config('os'),
|
||||
config = grunt.config('config'),
|
||||
configuration = grunt.config('msbuild_configuration'),
|
||||
output_path_base = 'bin\\'+ configuration +'\\',
|
||||
nuget_builds = grunt.config('nuget_builds'),
|
||||
tasks = [],
|
||||
clean_format = os === 'win' ? '{0} start-process ' +
|
||||
'-NoNewWindow ' +
|
||||
//'-WindowStyle Normal ' + //-WindowStyle (Hidden | Normal) | -NoNewWindow
|
||||
'-FilePath {1} ' +
|
||||
'-ArgumentList \' {2} /t:clean;Rebuild /p:Configuration={3} /p:OutputPath={4} \' ' :
|
||||
'{0} {1} /t:Rebuild /p:Configuration={2} ',
|
||||
//build_format = os === 'win' ? '{0} start-process ' +
|
||||
// '-NoNewWindow ' +
|
||||
// //'-WindowStyle Normal ' + //-WindowStyle (Hidden | Normal) | -NoNewWindow
|
||||
// '-FilePath {1} ' +
|
||||
// '-ArgumentList \' {2} /p:Configuration={3} \' ' :
|
||||
// '{0} {1} /p:Configuration={2}',
|
||||
i;
|
||||
|
||||
function addBuildWithTitle(title, dir, copyOnly) {
|
||||
var
|
||||
dir_path = string.format('{0}/../../Src/{1}/', __dirname, title),
|
||||
csproj = string.format('{0}{1}.csproj', dir_path, title),
|
||||
output_path = output_path_base + dir +'\\',
|
||||
clean = os === 'win' ? string.format(clean_format, config.win.powershell, config.win.msbuild, csproj, configuration, output_path) :
|
||||
string.format(clean_format, config.linux.msbuild, csproj, configuration),
|
||||
//build = os === 'win' ? string.format(build_format, config.win.powershell, config.win.msbuild, csproj, configuration ):
|
||||
// string.format(build_format, config.linux.msbuild, csproj, configuration),
|
||||
template_file_content = fs.readFileSync('./templates/AssemblyInfo.cs');
|
||||
|
||||
//template_file_content = S(template_file_content).replaceAll('@TITLE@', title).s;
|
||||
template_file_content = S(template_file_content).replaceAll('@VERSION@', config.version).s;
|
||||
//grunt.log.writeln('template_file_content = "%s"', template_file_content);
|
||||
fs.writeFileSync(string.format('{0}Properties/AssemblyInfo.cs', dir_path), template_file_content);
|
||||
if (!copyOnly) {
|
||||
tasks.push(clean);
|
||||
//tasks.push(build);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < nuget_builds.length; i++) {
|
||||
if (nuget_builds[i].Name !== 'SocketIoClientDotNet.netstandard1.3') {
|
||||
addBuildWithTitle(nuget_builds[i].Name, nuget_builds[i].NuGetDir, nuget_builds[i].copyOnly);
|
||||
}
|
||||
}
|
||||
|
||||
grunt.log.writeln('tasks = %s', JSON.stringify(tasks));
|
||||
grunt.config('shell.exec.command', tasks.join('&&'));
|
||||
grunt.task.run('shell');
|
||||
|
||||
if (configuration === 'Release') {
|
||||
grunt.task.run('clean:release');
|
||||
if (os === 'win') {
|
||||
grunt.task.run('copy:release');
|
||||
} else {
|
||||
grunt.task.run('copy:release_mono');
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
56
ThirdParty/SocketIoClientDotNet/grunt/tasks/build-test.js
vendored
Normal file
56
ThirdParty/SocketIoClientDotNet/grunt/tasks/build-test.js
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
module.exports = function (grunt) {
|
||||
|
||||
grunt.registerTask('buildTest',
|
||||
'test modules', function () {
|
||||
var
|
||||
fs = require('fs'),
|
||||
S = require('string'),
|
||||
string = require('string-formatter'),
|
||||
os = grunt.config('os'),
|
||||
config = grunt.config('config'),
|
||||
configuration = grunt.config('msbuild_configuration'),
|
||||
tasks = [],
|
||||
clean_format = os === 'win' ? '{0} start-process ' +
|
||||
'-NoNewWindow ' +
|
||||
//'-WindowStyle Normal ' + //-WindowStyle (Hidden | Normal) | -NoNewWindow
|
||||
'-FilePath {1} ' +
|
||||
'-ArgumentList \' {2} /t:clean /p:Configuration={3} \' ' :
|
||||
'{0} {1} /t:clean /p:Configuration={2}',
|
||||
build_format = os === 'win' ? '{0} start-process ' +
|
||||
'-NoNewWindow ' +
|
||||
//'-WindowStyle Normal ' + //-WindowStyle (Hidden | Normal) | -NoNewWindow
|
||||
'-FilePath {1} ' +
|
||||
'-ArgumentList \' {2} /p:Configuration={3} \' ' :
|
||||
'{0} {1} /p:Configuration={2}';
|
||||
|
||||
function addBuildWithTitle(title) {
|
||||
var
|
||||
dir_path = string.format('{0}/../../Src/{1}/', __dirname,title),
|
||||
csproj = string.format('{0}{1}.csproj', dir_path, title),
|
||||
clean = os === 'win' ? string.format(clean_format, config.win.powershell, config.win.msbuild, csproj, configuration ):
|
||||
string.format(clean_format, config.linux.msbuild, csproj, configuration),
|
||||
build = os === 'win' ? string.format(build_format, config.win.powershell, config.win.msbuild, csproj, configuration ):
|
||||
string.format(build_format, config.linux.msbuild, csproj, configuration),
|
||||
template_file_content = fs.readFileSync('./templates/AssemblyInfo.cs');
|
||||
|
||||
template_file_content = S(template_file_content).replaceAll('@VERSION@', config.version).s;
|
||||
//grunt.log.writeln('template_file_content = "%s"', template_file_content);
|
||||
fs.writeFileSync(string.format('{0}Properties/AssemblyInfo.cs', dir_path), template_file_content);
|
||||
|
||||
tasks.push(clean);
|
||||
tasks.push(build);
|
||||
}
|
||||
|
||||
if (os === 'win') {
|
||||
addBuildWithTitle('SocketIoClientDotNet.Tests.net45');
|
||||
} else {
|
||||
addBuildWithTitle('SocketIoClientDotNet.Tests.mono');
|
||||
}
|
||||
|
||||
grunt.log.writeln('tasks = %s', JSON.stringify(tasks));
|
||||
grunt.config('shell.exec.command', tasks.join('&&'));
|
||||
grunt.task.run('shell');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
99
ThirdParty/SocketIoClientDotNet/grunt/tasks/createNugetPackage.js
vendored
Normal file
99
ThirdParty/SocketIoClientDotNet/grunt/tasks/createNugetPackage.js
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
module.exports = function (grunt) {
|
||||
|
||||
grunt.registerTask('createNugetPackage',
|
||||
'create package ', function () {
|
||||
var
|
||||
fs = require('fs'),
|
||||
S = require('string'),
|
||||
string = require('string-formatter'),
|
||||
os = grunt.config('os'),
|
||||
config = grunt.config('config'),
|
||||
working_path = grunt.config('working_path'),
|
||||
package_path = working_path + '/NuGet/',
|
||||
package_lib_path = working_path + '/NuGet/lib/',
|
||||
//configuration = grunt.config('msbuild_configuration'),
|
||||
configuration = grunt.config('msbuild_configuration'),
|
||||
output_path_base = 'bin\\' + configuration + '\\',
|
||||
nuget_builds = grunt.config('nuget_builds'),
|
||||
nuget_path = os === 'win' ?
|
||||
config.win.nuget : config.linux.nuget,
|
||||
dst_path,
|
||||
template_file_content,
|
||||
i,
|
||||
tasks = [];
|
||||
|
||||
//function createPackageWithTitle(title) {
|
||||
// var
|
||||
// dir_path = string.format('{0}/../../{1}/', __dirname, title),
|
||||
// csproj = string.format('{0}{1}.csproj', dir_path, title),
|
||||
// pack = string.format('{0} pack {1}', nuget_path, csproj);
|
||||
|
||||
// tasks.push(pack);
|
||||
//}
|
||||
|
||||
if (os !== 'win') {
|
||||
return;
|
||||
}
|
||||
if (configuration !== 'Release') {
|
||||
grunt.log.writeln('wrong configuration = ' + configuration);
|
||||
return;
|
||||
}
|
||||
|
||||
//createPackageWithTitle('SocketIoClientDotNet');
|
||||
|
||||
|
||||
if (! fs.existsSync(working_path)) {
|
||||
fs.mkdirSync(working_path);
|
||||
fs.mkdirSync(package_path);
|
||||
fs.mkdirSync(package_lib_path);
|
||||
}
|
||||
if (!fs.existsSync(package_path)) {
|
||||
fs.mkdirSync(package_path);
|
||||
fs.mkdirSync(package_lib_path);
|
||||
}
|
||||
if (!fs.existsSync(package_lib_path)) {
|
||||
fs.mkdirSync(package_lib_path);
|
||||
}
|
||||
|
||||
for (i = 0; i < nuget_builds.length; i++) {
|
||||
dst_path = package_lib_path + nuget_builds[i].NuGetDir + '/';
|
||||
//files = fs.readdirSync(dst_path);
|
||||
grunt.log.writeln(string.format('dst_path={0}', dst_path));
|
||||
fs.mkdirSync(dst_path);
|
||||
}
|
||||
|
||||
|
||||
template_file_content = fs.readFileSync('./templates/SocketIoClientDotNet.nuspec');
|
||||
template_file_content = S(template_file_content).replaceAll('@VERSION@', config.version).s;
|
||||
fs.writeFileSync(string.format('{0}SocketIoClientDotNet.nuspec', package_path), template_file_content);
|
||||
|
||||
|
||||
|
||||
function addBuildWithTitle(title, destsubdir, srcsubdir) {
|
||||
var
|
||||
src_path = string.format('{0}/../../Src/{1}/{2}{3}/', __dirname, title, output_path_base, srcsubdir),
|
||||
dst_path = package_lib_path + destsubdir + '/',
|
||||
//src_file = string.format('{0}SocketIoClientDotNet.dll', src_path),
|
||||
src_file = string.format('{0}SocketIoClientDotNet.dll', src_path),
|
||||
dst_file = string.format('{0}SocketIoClientDotNet.dll', dst_path);
|
||||
|
||||
grunt.log.writeln(string.format('src_file={0} dst_file={1}', src_file, dst_file));
|
||||
fs.writeFileSync(dst_file, fs.readFileSync(src_file));
|
||||
|
||||
//src_file = src_path + string.format('{0}.xml', title);
|
||||
//dst_file = string.format('{0}SocketIoClientDotNet.xml', dst_path);
|
||||
//grunt.log.writeln(string.format('src_file={0} dst_file={1}', src_file, dst_file));
|
||||
//fs.writeFileSync(dst_file, fs.readFileSync(src_file));
|
||||
}
|
||||
|
||||
for (i = 0; i < nuget_builds.length; i++) {
|
||||
addBuildWithTitle(nuget_builds[i].Name, nuget_builds[i].NuGetDir, nuget_builds[i].SourceDir);
|
||||
}
|
||||
tasks.push('C:/WINDOWS/System32/WindowsPowerShell/v1.0/powershell.exe pwd');
|
||||
tasks.push(string.format('{0} pack SocketIoClientDotNet.nuspec', config.win.nuget));
|
||||
grunt.log.writeln('tasks = %s', JSON.stringify(tasks));
|
||||
grunt.config('shell.exec.options.execOptions.cwd', package_path);
|
||||
grunt.config('shell.exec.command', tasks.join('&&'));
|
||||
grunt.task.run('shell');
|
||||
});
|
||||
};
|
||||
45
ThirdParty/SocketIoClientDotNet/grunt/tasks/createXamarinComponent.js
vendored
Normal file
45
ThirdParty/SocketIoClientDotNet/grunt/tasks/createXamarinComponent.js
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
module.exports = function (grunt) {
|
||||
|
||||
grunt.registerTask('createXamarinComponent',
|
||||
'create component ', function () {
|
||||
var
|
||||
fs = require('fs'),
|
||||
S = require('string'),
|
||||
string = require('string-formatter'),
|
||||
os = grunt.config('os'),
|
||||
config = grunt.config('config'),
|
||||
xamarin_component = os === 'win' ? config.win.xamarin_component : config.linux.xamarin_component,
|
||||
working_path = grunt.config('working_path'),
|
||||
package_path = working_path + '/Component/',
|
||||
configuration = grunt.config('msbuild_configuration'),
|
||||
template_file_content,
|
||||
tasks = [];
|
||||
|
||||
if (configuration !== 'Release') {
|
||||
grunt.log.writeln('wrong configuration = ' + configuration);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (! fs.existsSync(working_path)) {
|
||||
fs.mkdirSync(working_path);
|
||||
fs.mkdirSync(package_path);
|
||||
}
|
||||
if (!fs.existsSync(package_path)) {
|
||||
fs.mkdirSync(package_path);
|
||||
}
|
||||
|
||||
|
||||
template_file_content = fs.readFileSync('./templates/SocketIoClientDotNet.yaml');
|
||||
template_file_content = S(template_file_content).replaceAll('@VERSION@', config.version).s;
|
||||
fs.writeFileSync(string.format('{0}component.yaml', package_path), template_file_content);
|
||||
|
||||
|
||||
tasks.push('echo %cd%');
|
||||
tasks.push(string.format('{0} package', xamarin_component));
|
||||
grunt.log.writeln('tasks = %s', JSON.stringify(tasks));
|
||||
grunt.config('shell.exec.options.execOptions.cwd', package_path);
|
||||
grunt.config('shell.exec.command', tasks.join('&&'));
|
||||
grunt.task.run('shell');
|
||||
});
|
||||
};
|
||||
32
ThirdParty/SocketIoClientDotNet/grunt/tasks/install-npm.js
vendored
Normal file
32
ThirdParty/SocketIoClientDotNet/grunt/tasks/install-npm.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
module.exports = function (grunt) {
|
||||
|
||||
grunt.registerTask('installNpm',
|
||||
'install node modules', function () {
|
||||
var
|
||||
string = require('string-formatter'),
|
||||
server_path2 = grunt.config('server_path'),
|
||||
os = grunt.config('os'),
|
||||
config = grunt.config('config'),
|
||||
win_pwd_command = string.format('{0} pwd', config.win.powershell);
|
||||
|
||||
grunt.log.writeln('server_path = "%s"', server_path2);
|
||||
grunt.log.writeln('win_pwd_command = "%s"', win_pwd_command);
|
||||
|
||||
if (os === 'win') {
|
||||
grunt.config('shell.exec.options.execOptions.cwd', '<%= server_path %>');
|
||||
|
||||
grunt.config('shell.exec.command', [win_pwd_command,
|
||||
'npm install'].join('&&'));
|
||||
grunt.task.run('shell');
|
||||
|
||||
} else {
|
||||
|
||||
grunt.config('shell.exec.options.execOptions.cwd', '<%= server_path %>');
|
||||
grunt.config('shell.exec.command', ['pwd', 'npm install'].join('&&'));
|
||||
grunt.task.run('shell');
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
40
ThirdParty/SocketIoClientDotNet/grunt/tasks/nuget.js
vendored
Normal file
40
ThirdParty/SocketIoClientDotNet/grunt/tasks/nuget.js
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
module.exports = function (grunt) {
|
||||
|
||||
grunt.registerTask('nuget',
|
||||
'get nuget assemblies', function () {
|
||||
var
|
||||
//fs = require('fs'),
|
||||
//S = require('string'),
|
||||
string = require('string-formatter'),
|
||||
os = grunt.config('os'),
|
||||
config = grunt.config('config'),
|
||||
//configuration = grunt.config('msbuild_configuration'),
|
||||
nuget_builds = grunt.config('nuget_builds'),
|
||||
nuget_path = os === 'win' ?
|
||||
config.win.nuget : config.linux.nuget,
|
||||
format_str = os === 'win' ?
|
||||
'{0} restore "{1}"' :
|
||||
'mono --runtime=v4.0.30319 {0} restore {1}',
|
||||
tasks = [],
|
||||
i;
|
||||
|
||||
function restorePackagesWithTitle(title) {
|
||||
var
|
||||
sln = string.format('{0}/../../Src/{1}/{2}.sln',__dirname, title,title),
|
||||
restore = string.format(format_str, nuget_path, sln);
|
||||
|
||||
tasks.push(restore);
|
||||
}
|
||||
|
||||
if (os === 'win') {
|
||||
for (i = 0; i < nuget_builds.length; i++) {
|
||||
restorePackagesWithTitle(nuget_builds[i].Name);
|
||||
}
|
||||
}
|
||||
|
||||
grunt.log.writeln('tasks = %s', JSON.stringify(tasks));
|
||||
grunt.config('shell.exec.command', tasks.join('&&'));
|
||||
grunt.task.run('shell');
|
||||
});
|
||||
};
|
||||
|
||||
44
ThirdParty/SocketIoClientDotNet/grunt/tasks/start-server.js
vendored
Normal file
44
ThirdParty/SocketIoClientDotNet/grunt/tasks/start-server.js
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
module.exports = function (grunt) {
|
||||
|
||||
grunt.registerTask('startServer',
|
||||
'start server', function () {
|
||||
var
|
||||
server_path = grunt.config('server_path'),
|
||||
os = grunt.config('os'),
|
||||
string = require('string-formatter'),
|
||||
config = grunt.config('config'),
|
||||
tasks = [],
|
||||
start,
|
||||
pwd;
|
||||
|
||||
grunt.log.writeln('server_path = "%s"', server_path);
|
||||
|
||||
if (os === 'win') {
|
||||
|
||||
start = '{0} start-process ' +
|
||||
'-NoNewWindow ' +
|
||||
//'-WindowStyle Normal ' + //-WindowStyle (Hidden | Normal) | -NoNewWindow
|
||||
'-FilePath node ' +
|
||||
'-ArgumentList \' server.js \' ';
|
||||
start = string.format(start, config.win.powershell);
|
||||
pwd = string.format('{0} pwd',config.win.powershell);
|
||||
|
||||
tasks.push(pwd);
|
||||
tasks.push(start);
|
||||
|
||||
grunt.log.writeln('tasks = %s', JSON.stringify(tasks));
|
||||
grunt.config('shell.exec.options.execOptions.cwd', '<%= server_path %>');
|
||||
grunt.config('shell.exec.command', tasks.join('&&'));
|
||||
grunt.task.run('shell');
|
||||
|
||||
} else {
|
||||
|
||||
grunt.config('shell.exec.options.execOptions.cwd', '<%= server_path %>');
|
||||
grunt.config('shell.exec.command', ['pwd', 'node server.js'].join('&&'));
|
||||
grunt.task.run('shell');
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
39
ThirdParty/SocketIoClientDotNet/grunt/tasks/test-client.js
vendored
Normal file
39
ThirdParty/SocketIoClientDotNet/grunt/tasks/test-client.js
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
module.exports = function (grunt) {
|
||||
|
||||
grunt.registerTask('testClient',
|
||||
'test cs', function () {
|
||||
var
|
||||
string = require('string-formatter'),
|
||||
os = grunt.config('os'),
|
||||
config = grunt.config('config'),
|
||||
tasks = [],
|
||||
configuration = grunt.config('msbuild_configuration'),
|
||||
test_format_str = os === 'win' ?
|
||||
'{0}/xunit.console.exe {1} -nunit test.xml -parallel none' :
|
||||
'mono {0}/xunit.console.clr4.exe {1}',
|
||||
|
||||
xunit_path = os === 'win' ?
|
||||
config.win.xunit_path : config.linux.xunit_path;
|
||||
|
||||
function addTestDllWithTitle(title) {
|
||||
var
|
||||
dir_path = string.format('{0}/../../Src/{1}/', __dirname, title),
|
||||
test_dll = string.format('{0}bin/{1}/{2}.dll', dir_path, configuration, title);
|
||||
|
||||
tasks.push( string.format(test_format_str,xunit_path, test_dll) );
|
||||
}
|
||||
|
||||
if (os === 'win') {
|
||||
addTestDllWithTitle('SocketIoClientDotNet.Tests.net45');
|
||||
} else {
|
||||
addTestDllWithTitle('SocketIoClientDotNet.Tests.mono');
|
||||
}
|
||||
|
||||
grunt.log.writeln('tasks = %s', JSON.stringify(tasks));
|
||||
grunt.config('shell.exec.command', tasks.join('&&'));
|
||||
grunt.task.run('shell');
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user