| <%# |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| * |
| * |
| -%> |
| |
| |
| apply plugin: 'application' |
| |
| mainClassName="<%= polygene.packageName %>.app.<%= polygene.name %>Launcher" |
| |
| applicationDefaultJvmArgs=[] |
| // GC Tuning strategies, see https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/ |
| // Strict memory bound |
| // applicationDefaultJvmArgs << "-Xmx512M -Xms512M" |
| // |
| // Goal oriented, "throughput" and "max pause" |
| // applicationDefaultJvmArgs << "-XX:MaxGCPauseMillis=300 -XX:GCTimeRatio=19" |
| // |
| // Garbage Collector |
| // OneOf; -XX:+UseG1GC, -XX:+UseConcMarkSweepGC, -XX:-UseParallelOldGC, -XX:+UseSerialGC |
| applicationDefaultJvmArgs << "-XX:+UseG1GC" |
| |
| |
| dependencies { |
| implementation project( ":bootstrap" ) |
| implementation project( ":model" ) |
| <% |
| if( polygene.applicationtype === 'Rest API' ) { |
| %> implementation project( ":rest" ) |
| implementation "org.apache.polygene.libraries:org.apache.polygene.library.restlet:$polygeneVersion" |
| runtimeOnly "org.restlet.jee:org.restlet.ext.servlet:$restletVersion" |
| <% |
| } |
| |
| if( hasFeature( 'security' ) ) { |
| %> implementation "org.apache.polygene.libraries:org.apache.polygene.library.shiro-web:$polygeneVersion" |
| <% |
| } |
| %> implementation "org.apache.polygene.core:org.apache.polygene.core.spi:$polygeneVersion" |
| implementation "org.apache.polygene.core:org.apache.polygene.core.bootstrap:$polygeneVersion" |
| |
| implementation "org.apache.polygene.extensions:org.apache.polygene.extension.entitystore-<%= polygene.entitystoremodule.toLowerCase() %>:$polygeneVersion" |
| implementation "org.apache.polygene.extensions:org.apache.polygene.extension.indexing-<%= polygene.indexing.toLowerCase() %>:$polygeneVersion" |
| implementation "org.apache.polygene.extensions:org.apache.polygene.extension.serialization-javaxjson:$polygeneVersion" |
| <% |
| if( polygene.caching !== "None" ) { |
| %> implementation "org.apache.polygene.extensions:org.apache.polygene.extension.cache-<%= polygene.caching.toLowerCase() %>:$polygeneVersion" |
| <% |
| } |
| if( polygene.metrics !== "None" ) { |
| %> implementation "org.apache.polygene.extensions:org.apache.polygene.extension.metrics-<%= polygene.metrics.toLowerCase() %>:$polygeneVersion" |
| <% |
| } |
| if( hasFeature( 'envisage' ) ) { |
| %> implementation "org.apache.polygene.tools:org.apache.polygene.tool.envisage:$polygeneVersion" |
| <% |
| } |
| if( polygene.entitystore == 'LevelDB' ) { |
| %> implementation "org.fusesource.leveldbjni:leveldbjni-all:$levelDbVersion" |
| <% |
| } |
| if( polygene.entitystore == 'DerbySQL' ) { |
| %> implementation "org.apache.derby:derby:$derbyVersion" |
| <% |
| } |
| if( polygene.entitystore == 'H2SQL' ) { |
| %> implementation "com.h2database:h2:$h2Version" |
| <% |
| } |
| if( polygene.entitystore == 'MySQL' ) { |
| %> implementation "mysql:mysql-connector-java:$mysqlVersion" |
| <% |
| } |
| if( polygene.entitystore == 'PostgreSQL' ) { |
| %> implementation "org.postgresql:postgresql:$postgresVersion" |
| <% |
| } |
| if( polygene.entitystore == 'SQLite' ) { |
| %> implementation "org.xerial:sqlite-jdbc:$sqliteVersion" |
| <% |
| } |
| %> |
| |
| runtimeOnly "org.apache.polygene.core:org.apache.polygene.core.runtime:$polygeneVersion" |
| runtimeOnly "org.apache.johnzon:johnzon-core:$johnzonVersion" |
| runtimeOnly "org.apache.johnzon:johnzon-mapper:$johnzonVersion" |
| runtimeOnly "org.apache.geronimo.specs:geronimo-json_1.1_spec:1.0" |
| runtimeOnly "ch.qos.logback:logback-classic:$logbackVersion" |
| runtimeOnly "ch.qos.logback:logback-core:$logbackVersion" |
| |
| testImplementation "org.apache.polygene.tools:org.apache.polygene.tool.model-detail:$polygeneVersion" |
| testImplementation "org.apache.polygene.core:org.apache.polygene.core.testsupport:$polygeneVersion" |
| testImplementation "com.github.tdomzal:junit-docker-rule:0.3" |
| } |
| |
| |
| task createConfigs { |
| def config = file("src/main/config") |
| outputs.dir config |
| doLast { |
| config.mkdirs() |
| } |
| } |
| |
| distributions { |
| main { |
| contents { |
| from(createConfigs) { |
| into "config" |
| } |
| } |
| } |
| } |