|
@@ -19,7 +19,6 @@ repositories {
|
|
|
group = 'pro.doczilla'
|
|
|
version = '1.0'
|
|
|
|
|
|
-def distDir = "${projectDir}/dist"
|
|
|
buildDir = "${projectDir}/target"
|
|
|
def srcDir = "src"
|
|
|
ext.srcMainDir = "${srcDir}"
|
|
@@ -30,35 +29,72 @@ def windows = org.apache.tools.ant.taskdefs.condition.Os.isFamily(org.apache.too
|
|
|
ext.npmCmd = windows ? 'npm.cmd' : 'npm'
|
|
|
ext.nodeCmd = windows ? 'node.exe' : 'node'
|
|
|
|
|
|
+def gitDefaults = [
|
|
|
+ adminPassword: '',
|
|
|
+ commentsRepoUrl: '',
|
|
|
+ gitUsername: '',
|
|
|
+ gitEmail: '',
|
|
|
+ gitPassword: ''
|
|
|
+].each {
|
|
|
+ if (!project.hasProperty(it.key))
|
|
|
+ ext[it.key] = it.value
|
|
|
+}
|
|
|
+
|
|
|
apply plugin: 'eclipse'
|
|
|
apply plugin: 'maven-publish'
|
|
|
apply plugin: 'distribution'
|
|
|
apply plugin: 'com.dorongold.task-tree'
|
|
|
|
|
|
task copySources {
|
|
|
- copy {
|
|
|
- from file("${projectDir}/package.json")
|
|
|
- into file(buildDir)
|
|
|
- }
|
|
|
- copy {
|
|
|
- from file("${distDir}")
|
|
|
- into file("${buildDir}/build/")
|
|
|
- }
|
|
|
-}
|
|
|
+ copy {
|
|
|
+ from file("${projectDir}/package.json")
|
|
|
+ into file(buildDir)
|
|
|
+ }
|
|
|
|
|
|
-task npmInstall(type: Exec) {
|
|
|
- workingDir projectDir
|
|
|
- commandLine npmCmd, 'install'
|
|
|
+ copy {
|
|
|
+ from file("${projectDir}/tsconfig.json")
|
|
|
+ into file(buildDir)
|
|
|
+ }
|
|
|
+
|
|
|
+ copy {
|
|
|
+ from file("${projectDir}/config.json")
|
|
|
+ into file(buildDir)
|
|
|
+ expand(adminPassword: adminPassword)
|
|
|
+ }
|
|
|
+
|
|
|
+ copy {
|
|
|
+ from file(projectDir)
|
|
|
+ include "*.tmpl"
|
|
|
+ into file(buildDir)
|
|
|
+ rename { fileName -> fileName.replace('.tmpl', '') }
|
|
|
+ expand(commentsRepoUrl: commentsRepoUrl, gitUsername: gitUsername, gitEmail: gitEmail, gitPassword: gitPassword)
|
|
|
+ }
|
|
|
+
|
|
|
+ copy {
|
|
|
+ from file("${projectDir}/src")
|
|
|
+ into file("${buildDir}/src")
|
|
|
+ }
|
|
|
+
|
|
|
+ copy {
|
|
|
+ from file("${projectDir}/node_scripts")
|
|
|
+ into file("${buildDir}/node_scripts")
|
|
|
+ }
|
|
|
+
|
|
|
+ copy {
|
|
|
+ from file("${projectDir}/static")
|
|
|
+ into file("${buildDir}/static")
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-task npmInstallProduction(type: Exec) {
|
|
|
+task npmInstall(type: Exec) {
|
|
|
dependsOn copySources
|
|
|
workingDir buildDir
|
|
|
- commandLine npmCmd, 'install', '--production=true'
|
|
|
+ commandLine npmCmd, 'install'
|
|
|
}
|
|
|
|
|
|
-task buildJs(type: Exec) {
|
|
|
- workingDir projectDir
|
|
|
+task buildTs(type: Exec) {
|
|
|
+ dependsOn npmInstall
|
|
|
+ workingDir buildDir
|
|
|
executable npmCmd
|
|
|
args = ['run', 'buildProd']
|
|
|
}
|
|
@@ -77,7 +113,10 @@ distZip {
|
|
|
archiveClassifier = today()
|
|
|
}
|
|
|
|
|
|
-project.tasks.distZip.dependsOn project.tasks.npmInstallProduction
|
|
|
+project.tasks.assemble.dependsOn project.tasks.buildTs
|
|
|
+project.tasks.distZip.dependsOn project.tasks.buildTs
|
|
|
+project.tasks.distTar.dependsOn project.tasks.buildTs
|
|
|
+project.tasks.installDist.dependsOn project.tasks.buildTs
|
|
|
|
|
|
distributions {
|
|
|
main {
|