Files
Marcus Handte 85c026fa8f
LocationBasedServices/maptology/pipeline/head This commit looks good
Upgrade gradle, plugins, android dependencies and angular code generator.
Upgrade gralde to latest version recommended by android studio.
Remove outdated android options in gradle properties.
Upgrade outdated gradle plugins to support npm downloads.
Upgrade android app dependencies to latest versions.
Make logger service constants static final.
Replace angular client generator with swagger codegen.
Adapt angular code to new client.
Integrate proxy config and basehref into angular cli configuration.
Change jenkinsfile to only deploy releases.
Change jenkinsfile to use gradle wrapper instead of fixed version.
Remove dots from user emails to not confuse simple email clients.
2020-06-20 10:28:43 +02:00

62 lines
1.5 KiB
Groovy

plugins {
id 'com.github.node-gradle.node' version '2.2.4'
id 'org.hidetake.swagger.generator' version '2.18.1'
}
description = 'Maptology Web Angular'
dependencies {
swaggerCodegen 'io.swagger:swagger-codegen-cli:2.4.12'
}
node {
version = '10.16.0'
npmVersion = '6.9.0'
download = true
}
class IoNodeTask extends com.moowork.gradle.node.task.NodeTask {
@Input
File inputFile;
@OutputDirectory
File outputDir;
}
task cleanApi(type: Delete) {
delete './src/api', './dist'
}
task ngBuild(type: IoNodeTask) {
script = file('node_modules/@angular/cli/bin/ng')
args = ['build', '--prod']
inputFile = project.file('./src/')
outputDir = project.file('./dist/')
}
swaggerSources {
maptology {
inputFile = file(project(':common-api:').buildDir.path + '/swagger/maptology.json')
code {
outputDir = file("./src/api/")
language = 'typescript-angular'
configFile = file('apiconfig.json')
components = [models: true, apis: 'Default', supportingFiles: 'configuration.ts,encoder.ts,api.ts,models.ts,variables.ts']
wipeOutputDir = true
}
}
}
// require api build to access swagger definition
tasks['resolveSwaggerTemplate'].dependsOn(project(':common-api').tasks['build'])
// make sure that common api is built before generating the api
ngBuild.dependsOn(npmInstall)
// generate the api before running ng build
ngBuild.dependsOn("generateSwaggerCode")
// run ng build whenever the project is built
build.dependsOn("ngBuild")
// clean the api folder upon clean
clean.dependsOn("cleanApi")