diff --git a/build.gradle b/build.gradle --- a/build.gradle +++ b/build.gradle @@ -2,15 +2,26 @@ if (release != 'rtm') { version += "-$release" } -println "version: $version" +if(!npmName) + npmName = name; + +ext.packageName="$npmScope/$npmName"; -def distDir = "$buildDir/dist" -def testDir = "$buildDir/test" +def packageDir = "$buildDir/dist" +def distDir = "$packageDir/$platform" +def testDir = "$packageDir/$platform" + +task printVersion { + println "version: $version" + println "packageName: $packageName" + println "platform: $platform" +} + task clean { doLast { delete buildDir - delete 'node_modules/@implab' + delete "node_modules/$packageName" } } @@ -40,7 +51,7 @@ task _buildTs(dependsOn: _npmInstall, ty inputs.file('tsconfig.json') outputs.dir(distDir) - commandLine 'node_modules/.bin/tsc', '-p', 'tsconfig.json' + commandLine 'node_modules/.bin/tsc', '-p', 'src/tsconfig.json', '--outDir', distDir } task _packageMeta(type: Copy) { @@ -64,7 +75,7 @@ task build(dependsOn: [_legacyJs, _npmIn task _localInstall(dependsOn: build, type: Exec) { inputs.file("$distDir/package.json") outputs.upToDateWhen { - new File("$projectDir/node_modules/@implab/core").exists() + new File("$projectDir/node_modules/$packageName").exists() } commandLine 'npm', 'install', '--no-save', '--force', distDir @@ -77,10 +88,10 @@ task copyJsTests(type: Copy) { task buildTests(dependsOn: _localInstall, type: Exec) { inputs.dir('test/ts') - inputs.file('tsconfig.test.json') + inputs.file('test/tsconfig.json') outputs.dir(testDir) - - commandLine 'node_modules/.bin/tsc', '-p', 'tsconfig.test.json' + + commandLine 'node_modules/.bin/tsc', '-p', 'test/tsconfig.json', '--outDir', distDir } task test(dependsOn: [copyJsTests, buildTests], type: Exec) { diff --git a/gradle.properties b/gradle.properties --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,8 @@ version=1.2.0 -release=rc \ No newline at end of file +release=rc +platform=amd +descriptrion=Dependency injection, logging, simple and fast text template engine +license=BSD-2-Clause +repository=https://bitbucket.org/implab/implabjs +npmScope=@implab +npmName=core \ No newline at end of file diff --git a/settings.gradle b/settings.gradle --- a/settings.gradle +++ b/settings.gradle @@ -12,4 +12,4 @@ //include 'sub-project-name' -rootProject.name = 'implab-core' \ No newline at end of file +rootProject.name = 'core' \ No newline at end of file diff --git a/src/package.template.json b/src/package.template.json new file mode 100644 --- /dev/null +++ b/src/package.template.json @@ -0,0 +1,23 @@ +{ + "name": "${packageName}", + "version": "${verstion}", + "description": "${description}", + "main": "main.js", + "keywords": [ + "di", + "ioc", + "logging", + "template engine", + "dependency injection" + ], + "author": "${author}", + "license": "${license}", + "repository": "$repository", + "publishConfig": { + "access": "public" + }, + "peerDependencies": { + "dojo": "^1.10.0" + } + } + \ No newline at end of file diff --git a/src/tsconfig.json b/src/tsconfig.json new file mode 100644 --- /dev/null +++ b/src/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "es3", + "module": "amd", + "sourceMap": true, + "declaration": true, + "lib": [ + "es5", + "es2015.promise", + "es2015.symbol" + ] + }, + "include" : [ + "ts/**/*.ts" + ] +} \ No newline at end of file diff --git a/test/tsconfig.json b/test/tsconfig.json new file mode 100644 --- /dev/null +++ b/test/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "es3", + "module": "amd", + "sourceMap": true, + "moduleResolution": "node", + "lib": [ + "es2015" + ] + }, + "include" : [ + "ts/**/*.ts" + ] +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 --- a/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "es3", - "module": "amd", - "sourceMap": true, - "outDir" : "build/dist", - "declaration": true, - "lib": [ - "es5", - "es2015.promise", - "es2015.symbol" - ] - }, - "include" : [ - "src/ts/**/*.ts" - ] -} \ No newline at end of file diff --git a/tsconfig.test.json b/tsconfig.test.json deleted file mode 100644 --- a/tsconfig.test.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "compilerOptions": { - "target": "es3", - "module": "amd", - "sourceMap": true, - "outDir" : "build/test", - "moduleResolution": "node", - "lib": [ - "es2015" - ] - }, - "include" : [ - "test/ts/**/*.ts" - ] -} \ No newline at end of file