-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
69 lines (56 loc) · 1.5 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
plugins {
id 'com.github.johnrengelman.shadow' version '2.0.1'
id "java"
id "application"
id "groovy"
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
jar {
mainClassName = 'azure.bleullc.Function'
}
defaultTasks 'run'
repositories {
mavenCentral()
}
dependencies {
compile 'com.microsoft.azure:azure-functions-java-core:1.0.0-beta-2'
compile 'org.codehaus.groovy:groovy-all:2.4.12'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
}
ext {
azureOutputDir = "$buildDir/azure-functions/"
}
task copyJar(type: Copy) {
from "$libsDir/${rootProject.name}-all.jar"
into azureOutputDir
rename { String fileName ->
fileName.replace("${rootProject.name}-all", 'function')
}
}
copyJar.dependsOn(build)
copyJar.group = 'azure'
task copyFunctionDefs(type: Copy) {
from "src/main/resources/functions"
into azureOutputDir
include('**/function.json')
}
copyFunctionDefs.group = 'azure'
task copyOpenApiDef(type: Copy) {
from "src/main/resources"
into azureOutputDir
include('swagger.*')
}
copyOpenApiDef.group = 'azure'
task cleanAzureFunction(type: Delete) {
delete azureOutputDir
}
cleanAzureFunction.group = 'azure'
task packageAzureFunction(type: Copy) {
from rootDir
into azureOutputDir
include('host.json', 'local.settings.json')
}
packageAzureFunction.dependsOn(cleanAzureFunction, build, copyJar, copyFunctionDefs, copyOpenApiDef)
//packageAzureFunction.dependsOn(build)
packageAzureFunction.group = 'azure'