Files
keycloak-webjar-provider/build.gradle
2025-06-27 12:16:40 +02:00

55 lines
1.6 KiB
Groovy

/**
* Copyright (C) 2025 John Ahlroos
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://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.
*/
apply plugin: 'java-library'
configurations {
webjar
}
repositories {
mavenCentral()
}
dependencies {
// Keycloak extension dependencies
compileOnly "org.keycloak:keycloak-services:${keycloakVersion}"
// Examples of how to include webjars (these are not required to build the extension)
webjar 'org.webjars.npm:hyperscript.org:0.9.8'
webjar 'org.webjars.npm:htmx.org:1.9.2'
webjar 'org.webjars:uikit:3.17.9'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
/**
* Composes the provider plugin and all webjars into a single directory that can be mounted (or copy & pasted) into
* the Keycloak docker image. See docker-compose.yml for example.
*/
tasks.register("composeProviders", Copy) {
group = 'keycloak'
from project.configurations.webjar
from project.tasks.jar
into project.layout.buildDirectory.dir("providers")
duplicatesStrategy "exclude"
doFirst{
delete project.layout.buildDirectory.dir("providers")
}
}