@@ -89,56 +89,81 @@ subprojects {
8989 ' -Ywarn-adapted-args'
9090 ]
9191
92- tasks. withType(ScalaCompile ) {
92+ tasks. withType(ScalaCompile ). configureEach {
9393 options. encoding = ' UTF-8'
9494 scalaCompileOptions. additionalParameters = scalacParameters
9595 }
9696
97- tasks. withType(ScalaDoc ) {
97+ tasks. withType(ScalaDoc ). configureEach {
9898 scalaDocOptions. additionalParameters = scalacParameters
9999 }
100100
101- task sourceJar( type : Jar ) {
101+ tasks . register( ' sourceJar ' , Jar ) {
102102 archiveClassifier = ' sources'
103103 from(sourceSets. main. allSource)
104104 }
105105
106- task docJar( type : Jar ) {
106+ tasks . register( ' docJar ' , Jar ) {
107107 dependsOn tasks. scaladoc
108108 archiveClassifier = ' javadoc'
109109 from(tasks. scaladoc. destinationDir)
110110 }
111111
112- task testJar( type : Jar ) {
112+ tasks . register( ' testJar ' , Jar ) {
113113 archiveClassifier = ' tests'
114114 from(sourceSets. test. output)
115115 }
116116
117- tasks. withType(Jar ) {
117+ tasks. withType(Jar ). configureEach {
118118 from(tasks. generateLicensesFiles) {
119119 into(" META-INF/" )
120120 }
121121 }
122122
123- task licenseFile {
123+ tasks . register( ' licenseFile' ) {
124124 outputs. file(project. parent. file(' LICENSE.txt' ))
125125 }
126126
127- task dependencySearch( type : DependencyInsightReportTask ) {
127+ tasks . register( ' dependencySearch ' , DependencyInsightReportTask ) {
128128 description = ' Searches all projects for a dependency'
129129 group = ' help'
130130 }
131131
132- task runApp {
132+ // TODO: it looks like this is only used for `:morpheus-examples` - we don't need it for all sub-projects 🤔
133+ // see: README.md:163
134+ tasks. register(' runApp' , JavaExec ) {
133135 dependsOn tasks. classes
134136 group = ' run'
135137 description = ' Run a custom Scala app (use -PmainClass=com.my.package.App)'
136- doLast {
137- javaexec {
138- classpath = sourceSets. main. runtimeClasspath
139- main = project. getProperty(" mainClass" )
140- }
141- }
138+
139+ classpath = sourceSets. main. runtimeClasspath
140+ mainClass = project. getProperty(" mainClass" )
141+ }
142+
143+ tasks. named(' runApp' ). configure {
144+ jvmArgs = [
145+ ' -Xmx2g' ,
146+ ' -Dconfig.file=app.conf' ,
147+ ' -XX:+IgnoreUnrecognizedVMOptions' ,
148+ ' --add-exports=java.base/sun.nio.ch=ALL-UNNAMED' ,
149+ ' --add-opens=java.base/java.lang.invoke=ALL-UNNAMED' ,
150+ ' --add-opens=java.base/java.lang=ALL-UNNAMED' ,
151+ ' --add-opens=java.base/java.lang.invoke=ALL-UNNAMED' ,
152+ ' --add-opens=java.base/java.lang.reflect=ALL-UNNAMED' ,
153+ ' --add-opens=java.base/java.io=ALL-UNNAMED' ,
154+ ' --add-opens=java.base/java.net=ALL-UNNAMED' ,
155+ ' --add-opens=java.base/java.nio=ALL-UNNAMED' ,
156+ ' --add-opens=java.base/java.util=ALL-UNNAMED' ,
157+ ' --add-opens=java.base/java.util.concurrent=ALL-UNNAMED' ,
158+ ' --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED' ,
159+ ' --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED' ,
160+ ' --add-opens=java.base/sun.nio.ch=ALL-UNNAMED' ,
161+ ' --add-opens=java.base/sun.nio.cs=ALL-UNNAMED' ,
162+ ' --add-opens=java.base/sun.security.action=ALL-UNNAMED' ,
163+ ' --add-opens=java.base/sun.util.calendar=ALL-UNNAMED' ,
164+ ' --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED' ,
165+ ' -Djdk.reflect.useDirectMethodHandle=false'
166+ ]
142167 }
143168
144169 // copied from https://stackoverflow.com/a/38058671/568723
0 commit comments