加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 4.01 KB
一键复制 编辑 原始数据 按行查看 历史
Dmitry Barashev 提交于 2024-01-04 14:25 . upgrade Kotlin and libs versions
import java.nio.file.Files
import java.nio.file.Paths
plugins {
id "org.jetbrains.kotlin.jvm" version "1.9.22" apply false
}
ext.distBinDir = file('ganttproject-builder/dist-bin')
ext.pluginsDir = file("ganttproject-builder/dist-bin/plugins/base")
def readVersion() {
return Files.readString(Paths.get(rootProject.projectDir.absolutePath, "ganttproject-builder", "VERSION")).trim()
}
version = System.getenv("VERSION") == null ? readVersion() : System.getenv("VERSION")
// Config for all projects: deps come from Maven repository,
// compile using Java 17, libs normally sit in lib
allprojects {
configurations {
direct
providedCompile
}
repositories {
mavenCentral()
google()
}
apply plugin: 'java'
ext {
libDir = 'lib'
mvnDir = 'lib/mvn'
kotlin_version = "1.9.22"
javaExportOptions = [
'--add-exports', 'javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED',
'--add-exports', 'javafx.base/com.sun.javafx.event=ALL-UNNAMED',
'--add-exports', 'javafx.base/com.sun.javafx=ALL-UNNAMED',
'--add-exports', 'javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED',
'--add-exports', 'javafx.controls/com.sun.javafx.scene.control.skin=ALL-UNNAMED',
'--add-exports', 'javafx.controls/com.sun.javafx.scene.control.skin.resources=ALL-UNNAMED',
'--add-exports', 'javafx.controls/com.sun.javafx.scene.control.inputmap=ALL-UNNAMED',
'--add-exports', 'javafx.graphics/com.sun.javafx.scene.traversal=ALL-UNNAMED',
'--add-exports', 'javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED',
'--add-exports', 'javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED',
'--add-exports', 'javafx.graphics/com.sun.javafx.util=ALL-UNNAMED',
'--add-opens', 'java.desktop/sun.swing=ALL-UNNAMED',
'--add-opens', 'java.desktop/sun.awt.X11=ALL-UNNAMED'
]
}
sourceCompatibility = 17
targetCompatibility = 17
clean {
delete += "dist-bin"
}
}
subprojects {
group 'biz.ganttproject'
version = new Date().format("yy.MM.dd") + "-SNAPSHOT"
}
def addPublishing(project) {
project.publishing {
repositories {
maven {
name "ganttproject-maven-repository-internal"
url "gcs://ganttproject-maven-repository/internal"
}
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/bardsoftware/ganttproject")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
}
}
}
def installLibs(jar, project) {
def pluginDistDir = new File(rootProject.pluginsDir, project.name)
copy {
into(new File(pluginDistDir, "lib/"))
from(configurations.direct) {
include "*.jar"
}
from(jar.outputs.getFiles().getFiles().flatten())
from(project.configurations.compileClasspath.minus(project.configurations.providedCompile.resolve())) {
include "*.jar"
}
rename { filename -> filename + ".lib" }
}
}
def install(task, jar, project) {
def pluginDistDir = new File(rootProject.pluginsDir, project.name)
task.doLast {
println ">>> ------------ Installing $project.name into $pluginDistDir ------------"
copy {
into(pluginDistDir)
from(fileTree(project.projectDir)) {
include "plugin.xml"
}
from(fileTree("$project.projectDir/src/main/")) {
include "resources/**"
}
}
installLibs(jar, project)
println "<<< $project.name"
}
}
//
//runtime {
// distDir = rootProject.distBinDir
// options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
// modules = ['java.base']
//}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化