Added npm packaging option

This commit is contained in:
Hristo Hristov
2015-12-16 14:23:55 +02:00
parent f5dc47bc64
commit 4e31cc6a2e
3 changed files with 72 additions and 0 deletions

1
.gitignore vendored
View File

@@ -6,3 +6,4 @@
.DS_Store .DS_Store
/build /build
/captures /captures
/node_modules

45
Gruntfile.js Normal file
View File

@@ -0,0 +1,45 @@
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
clean: {
build: ["build"]
},
exec: {
npm_pack: {
cmd: 'npm pack ./package',
cwd: 'build/'
},
gradle: 'gradle build'
},
copy: {
package: {
files: [
{ expand: true, src: 'package.json', dest: 'build/package' },
{ expand: true, cwd: 'widgets/build/outputs/aar', src: 'widgets-release.aar', dest: 'build/package/platforms/android' }
]
}
},
mkdir: {
build: {
options: {
create: ["build/package"]
}
}
}
});
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-mkdir');
// Default task(s).
grunt.registerTask('default', [
'clean:build',
'mkdir:build',
'exec:gradle',
'copy:package',
'exec:npm_pack'
]);
};

26
package.json Normal file
View File

@@ -0,0 +1,26 @@
{
"name": "tns-core-modules-widgets",
"version": "1.0.0",
"description": "Native widgets used in the NativeScript framework.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/NativeScript/android-widgets.git"
},
"author": "NativeScript team",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/NativeScript/android-widgets/issues"
},
"homepage": "https://github.com/NativeScript/android-widgets#readme",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-copy": "^0.8.0",
"grunt-exec": "^0.4.6",
"grunt-mkdir": "^0.1.2"
}
}