import org.teavm.buildutil.DependencyRelocationExtension /* * Copyright 2023 Alexey Andreev. * * 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. */ pluginManagement { repositories { gradlePluginPortal() } includeBuild("build-logic") } plugins { id("dependency-relocation") } rootProject.name = "teavm" include("core") include("interop:core") include("metaprogramming:api", "metaprogramming:impl") include("jso:core", "jso:apis", "jso:impl") include("platform") include("classlib") include("tools:core") include("tools:deobfuscator-js") include("tools:junit") include("tools:devserver") include("tools:c-incremental") include("tools:chrome-rdp") include("tools:cli") include("tools:gradle") include("tools:ide-deps") include("tools:idea") include("tools:maven:plugin") include("tools:maven:webapp") include("tools:classlib-comparison-gen") include("tests") include("extras-slf4j") val teavmVersion = providers.gradleProperty("teavm.project.version").get() gradle.allprojects { repositories { mavenCentral() } version = teavmVersion } gradle.afterProject { val java = extensions.findByType() if (java != null) { apply() extensions.configure { toolVersion = extensions.getByType().named("libs") .findVersion("checkstyle").get().requiredVersion } java.toolchain { if (!languageVersion.isPresent) { languageVersion.set(JavaLanguageVersion.of(11)) } } } extensions.findByType()?.apply { publications.all { if (this is MavenPublication) { pom { setupPom() } } } } } fun MavenPom.setupPom() { licenses { license { name.set("The Apache Software License, Version 2.0") url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") distribution.set("repo") comments.set("A business-friendly OSS license") } } developers { developer { id.set("konsoletyper") name.set("Alexey Andreev") email.set("konsoletyper@gmail.com") timezone.set("Europe/Berlin") } } scm { url.set("https://github.com/konsoletyper/teavm") connection.set("scm:git:git@github.com:konsoletyper/teavm.git") } url.set("https://teavm.org") } extensions.configure { library("libs", "commons-io") { relocate("org.apache.commons", "org.teavm.apachecommons") } for (asmLib in listOf("asm", "asm-tree", "asm-analysis", "asm-commons", "asm-util")) { library("libs", asmLib) { relocate("org.objectweb.asm", "org.teavm.asm") } } library("libs", "rhino") { relocate("org.mozilla", "org.teavm.rhino") } library("libs", "hppc") { relocate("com.carrotsearch.hppc", "org.teavm.hppc") } skip(":tools:gradle") }