mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Added npm packaging option
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,3 +6,4 @@
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
/node_modules
|
||||
45
Gruntfile.js
Normal file
45
Gruntfile.js
Normal 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
26
package.json
Normal 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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user