forked from galasa-dev/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
73 lines (61 loc) · 2.74 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
70
//
// Objectives:
//
// - The galasactl tool needs to embed the galasa-boot.jar so that the jar can be
// unpacked on disk and used to launch testcases in a local jvm.
// So we need to get hold of this boot jar.
//
// - The galasactl tool needs to talk to the API server via an HTTP client layer,
// which is generated from a yaml definition file.
// So we need to get hold of a generator tool so we can
//
// Note: The following versions are picked up by the build process and fed
// into the code, so the code knows what versions of galasa it should be
// dealing with. Do not mess with the `def {variableName}` part of hte following
// lines, only change the versions we rely upon.
def galasaBootJarVersion = '0.31.0'
def galasaFrameworkVersion = '0.33.0'
// Right now, the REST interface spec is always the same version as the galasa framework bundles.
def galasaOpenApiYamlVersion = galasaFrameworkVersion
repositories {
gradlePluginPortal()
mavenLocal()
maven {
url "https://development.galasa.dev/main/maven-repo/obr/"
}
mavenCentral()
}
apply plugin: 'java'
dependencies {
// We need the galasa-boot jar so we can launch tests in a local JVM
implementation 'dev.galasa:galasa-boot:' + galasaBootJarVersion
// We need the openapi generator to turn a yaml file into go client stubs,
// so we can call the api server REST services
// https://mvnrepository.com/artifact/org.openapitools/openapi-generator
implementation 'org.openapitools:openapi-generator-cli:6.6.0'
// Download the openapi.yaml specification for the REST APIs.
compileOnly group: "dev.galasa", name: "dev.galasa.framework.api.openapi", version: "$galasaOpenApiYamlVersion", ext: "yaml"
}
task downloadRawDependencies(type: Copy) {
// Download the dependencies onto the local disk.
from configurations.compileClasspath
into 'build/dependencies'
dependsOn configurations.compileClasspath
}
task downloadDependencies(type: Copy) {
// Rename the complex openapi.yaml file into something easier to use elsewhere.
// So the path to the new file is build/dependencies/openapi.yaml
from "build/dependencies/dev.galasa.framework.api.openapi-${galasaOpenApiYamlVersion}.yaml"
into "build/dependencies"
rename { fileName -> "openapi.yaml" }
dependsOn downloadRawDependencies
}
//tasks.register('installJarsIntoTemplates', Copy) {
task installJarsIntoTemplates(type: Copy) {
// We want to embed some files into the executable.
// Copy the files into the go templates folder.
from layout.buildDirectory.file("dependencies/galasa-boot-"+galasaBootJarVersion+".jar")
into layout.buildDirectory.dir("../pkg/embedded/templates/galasahome/lib")
dependsOn downloadDependencies
}
description = 'Galasa CLI'