Skip to content

Commit

Permalink
merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
karianna committed Sep 30, 2024
2 parents 571bd4c + b85d15d commit e0b961b
Show file tree
Hide file tree
Showing 133 changed files with 2,151 additions and 1,840 deletions.
11 changes: 11 additions & 0 deletions .run/Main.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Main" type="Application" factoryName="Application">
<option name="ALTERNATIVE_JRE_PATH" value="corretto-20" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="MAIN_CLASS_NAME" value="pcgen.system.Main" />
<module name="pcgen.main" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ This is almost exactly the command Travis runs to verify, if it fails locally yo
### Generate IntelliJ IDEA Project
./gradlew idea

## Troubleshooting
####
If you have an error stating `Task :run FAILED Error: --module-path requires module path specification` in Intellij,
create a run configuration using Gradle and have the command be `run`. This should fix this error.

If you want to debug in Intellij, using the `Main` configuration and run it in debug mode.
You can change the Java version to whatever version is supported, and you have installed.


[PCGen]: https://github.com/PCGen/pcgen
[JIRA]: https://pcgenorg.atlassian.net
[CODE]: https://pcgenorg.atlassian.net/projects/CODE/issues
Expand Down
3 changes: 1 addition & 2 deletions build-gradle.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
build-gradle.xml - a stub ant file to allow gradle to include just the plugin build tasks.
build-gradle.xml - a stub ant file to allow Gradle to include just the plugin build tasks.
-->
<project name="pcgen" basedir=".">
<property name="manifest.file" value="code/manifest" />
Expand Down
915 changes: 454 additions & 461 deletions build.gradle

Large diffs are not rendered by default.

28 changes: 15 additions & 13 deletions code/gradle/autobuild.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,42 @@ import java.time.LocalDateTime
*/
ext {
if (System.env.BUILD_NUMBER) {
destAutobuildDir = '/home/pcgen1/public_html/autobuilds/'
destAutobuildDir = file('/home/pcgen1/public_html/autobuilds/')
} else {
destAutobuildDir = "${buildDir}/autobuilds/"
destAutobuildDir = layout.buildDirectory.dir("autobuilds").get()
}

buildTimestamp = LocalDateTime.now(Clock.systemUTC())
}

task copyDocs(type: Sync) {
tasks.register("copyDocs", Sync) {
from 'docs'
into "${destAutobuildDir}/pcgen-docs/"
into destAutobuildDir.dir("pcgen-docs/")
}

task copyDist(type: Sync, dependsOn: 'buildDist') {
from "${buildDir}/distributions"
into "${destAutobuildDir}/downloads/"
tasks.register("copyDist", Sync) {
dependsOn buildDist
from layout.buildDirectory.dir("distributions")
into destAutobuildDir.dir("downloads")
}

task copySite(type: Copy) {
tasks.register("copySite", Copy) {
// Ensure this always runs - we don't want an incorrect date
outputs.upToDateWhen { false }
from "${projectDir}/code/gradle/site"
into "${destAutobuildDir}"
from layout.projectDirectory.dir("code/gradle/site")
into destAutobuildDir
expand(copyright: Calendar.instance.get(Calendar.YEAR), version: version, timestamp: buildTimestamp,
simpleVersion: version.replaceAll('-SNAPSHOT', '').replaceAll(/\./, ''))
}

task copyInstaller(type: Copy) {
tasks.register("copyInstaller", Copy) {
// Ensure this always runs - we don't want an outdated installer
outputs.upToDateWhen { false }
from "${releaseDir}"
into "${destAutobuildDir}/downloads/"
into destAutobuildDir.dir("downloads")
}

// The Main Task
task deployAutobuild (dependsOn: ['copyDocs', 'copyDist', 'copySite', 'copyInstaller']) {
tasks.register("deployAutobuild") {
dependsOn copyDocs, copyDist, copySite, copyInstaller
}
56 changes: 33 additions & 23 deletions code/gradle/distribution.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ext {
}

programDistsImage = copySpec {
from("$buildDir/launch4j") {
from(layout.buildDirectory.dir("launch4j")) {
include 'pcgen.exe'
}
}
Expand All @@ -55,7 +55,7 @@ ext {
from('code') {
include 'LICENSE'

eachFile{ file ->
eachFile { file ->
if(file.getName().endsWith(".sh")) {
file.setMode(0755)
}
Expand All @@ -64,7 +64,7 @@ ext {
}

libsDistsImage = copySpec {
from("$buildDir/libs") {
from(layout.buildDirectory.dir("libs")) {
into 'libs'
exclude 'pcgen-*.jar'
}
Expand All @@ -83,7 +83,7 @@ ext {
}
}

application{
application {
// Output the startScripts (.bat and .sh) in main distribute folder rather than .bin
executableDir = ""
applicationDefaultJvmArgs = ["-Dsun.java2d.d3d=false"]
Expand All @@ -96,33 +96,39 @@ application{
applicationDistribution.with(programDistsImage)
}

run {
tasks.named("run") {
dependsOn assemble, extractJavaFXLocal
// Required to fixed incorrectly added "--module-path" and adds correct modules.
doFirst {

jvmArgs = ["-ea", // -ea enables assertions
"--enable-preview", // enable Java preview features
"--module-path",
"${projectDir}/mods/lib/",
"--add-modules", "javafx.controls,javafx.web,javafx.swing,javafx.fxml"
"--module-path", layout.projectDirectory.dir("mods/lib").asFile.absolutePath,
"--add-modules", "javafx.controls,javafx.web,javafx.swing,javafx.fxml,javafx.graphics"
]

}
}
tasks.run.dependsOn(assemble)
tasks.run.dependsOn(downloadJavaFXModules)

installDist.doLast{
delete {
delete fileTree("${buildDir}/install/pcgen/lib") {
include 'javafx-*'
tasks.named("installDist") {
dependsOn createExe
doLast{
delete {
delete fileTree(layout.buildDirectory.dir("install/pcgen/lib")) {
include 'javafx-*'
}
}
}
}

[distZip, distTar, installDist]*.dependsOn createExe
tasks.named("distTar") {
dependsOn createExe
}

tasks.named("distZip") {
dependsOn createExe
}

task testZip(type: Zip, dependsOn: ['converterJar', 'copyToLibs', 'copyToOutput']) {
tasks.register("testZip", Zip) {
dependsOn converterJar, copyToLibs, copyToOutput
archiveClassifier.set('test')
into(zipRootFolder) {
with dataDistsImage
Expand All @@ -134,23 +140,25 @@ task testZip(type: Zip, dependsOn: ['converterJar', 'copyToLibs', 'copyToOutput'
}
}

task dataZip(type: Zip, dependsOn: ['copyMasterSheets']) {
tasks.register("dataZip", Zip) {
dependsOn copyMasterSheets
archiveClassifier.set('data')
into(zipRootFolder) {
with dataDistsImage
with autobuildSpec
}
}

task docsZip(type: Zip) {
tasks.register("docsZip", Zip) {
archiveClassifier.set('docs')
into(zipRootFolder) {
with docsDistsImage
with autobuildSpec
}
}

task programZip(type: Zip, dependsOn: ['converterJar', 'createExe']) {
tasks.register("programZip", Zip) {
dependsOn converterJar, createExe
archiveClassifier.set('program')
into(zipRootFolder) {
with programDistsImage
Expand All @@ -159,14 +167,16 @@ task programZip(type: Zip, dependsOn: ['converterJar', 'createExe']) {
}
}

task libsZip(type: Zip, dependsOn: 'copyToLibs') {
tasks.register("libsZip", Zip) {
dependsOn copyToLibs
archiveClassifier.set('libs')
into(zipRootFolder) {
with libsDistsImage
with autobuildSpec
}
}

task buildDist(dependsOn: ['dataZip', 'docsZip', 'programZip', 'libsZip', 'runtimeZip']) {
tasks.register("buildDist") {
dependsOn dataZip, docsZip, programZip, libsZip, runtimeZip
description = "Build the five zip files (docs, data, program, libs and full) which comprise the autobuild distribution."
}
Loading

0 comments on commit e0b961b

Please sign in to comment.