From 8e4536f9cd5d0ac1b23730e96ce3e3fe5fd63ec2 Mon Sep 17 00:00:00 2001 From: ajay-gov Date: Sat, 8 Apr 2023 11:20:29 -0700 Subject: [PATCH] Build and run the app without using java modules --- server/build.gradle | 111 -------------------------- server/src/main/java/module-info.java | 7 -- 2 files changed, 118 deletions(-) delete mode 100644 server/src/main/java/module-info.java diff --git a/server/build.gradle b/server/build.gradle index 4394137..51d4e1d 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -10,7 +10,6 @@ plugins { id "java" id "java-library" id "application" - id "nebula.ospackage-application" version "8.3.0" } group = 'org.swimos' @@ -32,113 +31,3 @@ dependencies { api group: 'org.swimos', name: 'swim-server', version: version api group: 'org.swimos', name: 'swim-client', version: version } - -afterEvaluate { - - sourceSets { - main.output.resourcesDir = main.java.outputDir - } - - compileJava { - if (useModules) { - doFirst { - options.compilerArgs += [ - '--module-path', classpath.asPath, - '--patch-module', "$moduleName=" - + files(sourceSets.main.resources.srcDirs).asPath, - ] - classpath = files() - } - } - options.compilerArgs += ['-Xlint'] - options.encoding = 'UTF-8' - } - - jar { - inputs.property('moduleName', moduleName) - manifest { - attributes( - 'Implementation-Title': moduleName, - 'Implementation-Version': version, - 'Main-Class': mainClassName) - } - } - - tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' - if (!useModules) { - exclude '*module-info*' - } - } - - run { - dependsOn jar - doFirst { - jvmArgs += [ - '--module-path', files(configurations.runtimeClasspath, jar.archiveFile).asPath, - '--module', "${moduleName}/${mainClassName}" - ] - classpath = files() - } - } - - startScripts { - inputs.property("moduleName", moduleName) - doFirst { - classpath = files() - defaultJvmOpts = [ - '-Dswim.config=/server.recon', - '-Xms3g', - '-Xmx3g', - '--module-path', 'APP_HOME_LIBS', - '--module', "${moduleName}/${mainClassName}" - ] - } - doLast { - def bashFile = new File(outputDir, applicationName) - String bashContent = bashFile.text - bashFile.text = bashContent.replaceFirst('APP_HOME_LIBS', Matcher.quoteReplacement('$APP_HOME/lib')) - - def batFile = new File(outputDir, applicationName + ".bat") - String batContent = batFile.text - batFile.text = batContent.replaceFirst('APP_HOME_LIBS', Matcher.quoteReplacement('%APP_HOME%\\lib')) - } - } - - ospackage { - release '1' - prefix '/opt/swim-tutorial' - } - - task packageDeb(type: Deb) { - maintainer = 'developer@swim.inc' - - configurationFile("/etc/sysconfig/${project.name}") - preInstall "addgroup --quiet --system ${project.name}" - preInstall "adduser --quiet --system --ingroup ${project.name} --no-create-home --disabled-password ${project.name}" - postInstall "systemctl preset ${project.name} > /dev/null 2>&1" - postInstall "systemctl start ${project.name} > /dev/null 2>&1" - preUninstall "systemctl disable ${project.name} > /dev/null 2>&1" - preUninstall "systemctl stop ${project.name} > /dev/null 2>&1" - postUninstall "systemctl daemon-reload > /dev/null 2>&1" - - from('pkg') { - into '/etc/systemd/system' - include '*.service' - addParentDirs false - expand project.properties - user 'root' - permissionGroup 'root' - fileMode = 0644 - } - - from('pkg') { - into '/etc/sysconfig' - include "${project.name}" - user 'root' - permissionGroup 'root' - fileMode = 0644 - fileType CONFIG | NOREPLACE - } - } -} diff --git a/server/src/main/java/module-info.java b/server/src/main/java/module-info.java deleted file mode 100644 index c6ccb13..0000000 --- a/server/src/main/java/module-info.java +++ /dev/null @@ -1,7 +0,0 @@ -open module swim.tutorial { - requires transitive swim.api; - requires swim.server; - requires swim.client; - - exports swim.tutorial; -} pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy