mirror of
https://github.com/octoleo/plantuml.git
synced 2024-11-05 21:17:52 +00:00
chore: Build MIT version
This commit is contained in:
parent
ba0fd1efb4
commit
62d43e22a8
48
.github/workflows/ci-mit.yml
vendored
Normal file
48
.github/workflows/ci-mit.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
name: ci-mit
|
||||
'on':
|
||||
create: null
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- docs/**
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- docs/**
|
||||
workflow_dispatch: null
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
jobs:
|
||||
workflow_config:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
do_release: '${{ steps.config.outputs.do_release }}'
|
||||
do_snapshot_release: '${{ steps.config.outputs.do_snapshot_release }}'
|
||||
pom_version: '${{ steps.config.outputs.pom_version }}'
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Run pre-processor
|
||||
run: |
|
||||
ls -l
|
||||
java -jar sjpp.jar
|
||||
java -jar sjpp.jar src src-mit __MIT__
|
||||
ls -l
|
||||
- name: Rename build-mit.gradle
|
||||
run: |
|
||||
ls -l *.kts
|
||||
cp build-mit.gradle.kts build.gradle.kts
|
||||
ls -l *.kts
|
||||
- name: Compile
|
||||
run: gradle -q compileJava --no-daemon
|
||||
- name: print version
|
||||
run: |
|
||||
ls -l build/libs
|
||||
java -version build/libs/*.jar
|
79
build-mit.gradle.kts
Normal file
79
build-mit.gradle.kts
Normal file
@ -0,0 +1,79 @@
|
||||
// permits to start the build setting the javac release parameter, no parameter means build for java8:
|
||||
// gradle clean build -x javaDoc -PjavacRelease=8
|
||||
// gradle clean build -x javaDoc -PjavacRelease=17
|
||||
// also supported is to build first, with java17, then switch the java version, and run the test with java8:
|
||||
// gradle clean build -x javaDoc -x test
|
||||
// gradle test
|
||||
val javacRelease = (project.findProperty("javacRelease") ?: "8") as String
|
||||
|
||||
plugins {
|
||||
java
|
||||
`maven-publish`
|
||||
signing
|
||||
}
|
||||
|
||||
group = "net.sourceforge.plantuml"
|
||||
description = "PlantUML"
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
withJavadocJar()
|
||||
registerFeature("pdf") {
|
||||
usingSourceSet(sourceSets["main"])
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.apache.ant:ant:1.10.13")
|
||||
testImplementation("org.assertj:assertj-core:3.24.2")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
|
||||
testImplementation("org.scilab.forge:jlatexmath:1.0.7")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDirs("src-mit")
|
||||
}
|
||||
resources {
|
||||
srcDirs("src-mit")
|
||||
include("**/*.png")
|
||||
include("**/*.svg")
|
||||
include("**/*.txt")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.compileJava {
|
||||
if (JavaVersion.current().isJava8) {
|
||||
java.targetCompatibility = JavaVersion.VERSION_1_8
|
||||
} else {
|
||||
options.release.set(Integer.parseInt(javacRelease))
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Jar>().configureEach {
|
||||
manifest {
|
||||
attributes["Main-Class"] = "net.sourceforge.plantuml.Run"
|
||||
attributes["Implementation-Version"] = archiveVersion
|
||||
attributes["Build-Jdk-Spec"] = System.getProperty("java.specification.version")
|
||||
from("manifest.txt")
|
||||
}
|
||||
from("skin") { into("skin") }
|
||||
from("stdlib") { into("stdlib") }
|
||||
from("svg") { into("svg") }
|
||||
from("themes") { into("themes") }
|
||||
// source sets for java and resources are on "src", only put once into the jar
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
|
||||
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user