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