-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
79 lines (71 loc) · 2.63 KB
/
build.gradle.kts
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
71
72
73
74
75
76
77
78
79
/*
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
*
*/
import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage
import com.github.jengelman.gradle.plugins.shadow.ShadowJavaPlugin
/*
*
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
*
*/
plugins {
id("application")
alias(libs.plugins.shadow)
alias(libs.plugins.docker)
}
dependencies {
runtimeOnly(project(":extensions:example-extension"))
runtimeOnly(libs.edc.bom.controlplane)
// uncomment the following lines to compile with Hashicorp Vault and Postgres persistence
// runtimeOnly(libs.edc.vault.hashicorp)
// runtimeOnly(libs.edc.bom.controlplane.sql)
}
tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
exclude("**/pom.properties", "**/pom.xm")
mergeServiceFiles()
archiveFileName.set("${project.name}.jar")
}
application {
mainClass.set("org.eclipse.edc.boot.system.runtime.BaseRuntime")
}
edcBuild {
publish.set(false)
}
// configure the "dockerize" task
tasks.register("dockerize", DockerBuildImage::class) {
val dockerContextDir = project.projectDir
dockerFile.set(file("$dockerContextDir/src/main/docker/Dockerfile"))
images.add("${project.name}:${project.version}")
images.add("${project.name}:latest")
// specify platform with the -Dplatform flag:
if (System.getProperty("platform") != null)
platform.set(System.getProperty("platform"))
buildArgs.put("JAR", "build/libs/${project.name}.jar")
inputDir.set(file(dockerContextDir))
dependsOn(tasks.named(ShadowJavaPlugin.SHADOW_JAR_TASK_NAME))
}