2019-10-15 00:25:58 +03:00
|
|
|
plugins {
|
|
|
|
id 'java'
|
|
|
|
id 'idea'
|
|
|
|
id 'eclipse'
|
|
|
|
id 'maven-publish'
|
2020-09-02 20:32:02 +03:00
|
|
|
id 'signing'
|
2019-10-15 00:25:58 +03:00
|
|
|
id 'jacoco'
|
|
|
|
id 'distribution'
|
|
|
|
id 'checkstyle'
|
2021-04-15 20:30:41 +03:00
|
|
|
id 'com.diffplug.spotless' version "5.12.1"
|
2021-05-14 04:04:14 +03:00
|
|
|
id 'com.github.spotbugs' version "4.7.1"
|
2019-10-15 00:25:58 +03:00
|
|
|
}
|
2015-04-25 08:52:10 +03:00
|
|
|
|
2019-10-15 02:16:51 +03:00
|
|
|
tasks.withType(JavaCompile) {
|
|
|
|
sourceCompatibility = 1.8
|
|
|
|
targetCompatibility = 1.8
|
|
|
|
options.encoding = "UTF-8"
|
2020-06-19 02:45:30 +03:00
|
|
|
options.compilerArgs = [ "-Xlint:deprecation,unchecked" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
compileTestJava {
|
|
|
|
options.compilerArgs = [ ]
|
2019-10-15 02:16:51 +03:00
|
|
|
}
|
2015-04-25 08:52:10 +03:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
java {
|
|
|
|
srcDirs 'src', 'toolsrc', 'xmlimplsrc'
|
|
|
|
}
|
|
|
|
resources {
|
|
|
|
srcDirs 'src', 'toolsrc'
|
2017-09-26 22:44:40 +03:00
|
|
|
exclude "build.xml"
|
|
|
|
exclude "manifest"
|
2015-04-25 08:52:10 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
java {
|
|
|
|
srcDirs "testsrc", 'examples'
|
|
|
|
exclude 'tests/**'
|
|
|
|
}
|
|
|
|
resources {
|
|
|
|
srcDirs "testsrc"
|
|
|
|
}
|
|
|
|
}
|
2020-06-10 01:10:27 +03:00
|
|
|
|
|
|
|
jmh {
|
|
|
|
java {
|
|
|
|
srcDirs "benchmarks"
|
|
|
|
}
|
|
|
|
compileClasspath += sourceSets.test.runtimeClasspath
|
|
|
|
runtimeClasspath += sourceSets.test.runtimeClasspath
|
|
|
|
}
|
2015-04-25 08:52:10 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2021-02-24 05:01:44 +03:00
|
|
|
testImplementation "junit:junit:4.13.2"
|
|
|
|
testImplementation "org.yaml:snakeyaml:1.28"
|
|
|
|
testImplementation "javax.xml.soap:javax.xml.soap-api:1.4.0"
|
2020-06-10 01:10:27 +03:00
|
|
|
jmhImplementation project
|
2021-02-24 05:01:44 +03:00
|
|
|
jmhImplementation 'org.openjdk.jmh:jmh-core:1.27'
|
|
|
|
jmhAnnotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.27'
|
2015-04-25 08:52:10 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
2017-11-17 20:23:03 +03:00
|
|
|
useJUnit()
|
2015-04-25 13:51:51 +03:00
|
|
|
exclude "**/benchmarks/**"
|
2021-09-26 15:52:11 +03:00
|
|
|
|
2020-06-22 23:32:45 +03:00
|
|
|
jvmArgs += '-Xss1280k'
|
2019-04-03 23:25:52 +03:00
|
|
|
|
2021-09-26 15:52:11 +03:00
|
|
|
if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
|
|
|
|
jvmArgs += ['--add-opens', 'java.desktop/javax.swing.table=ALL-UNNAMED']
|
|
|
|
}
|
|
|
|
|
2019-04-03 23:25:52 +03:00
|
|
|
jacoco.excludes = ['**/testsrc_tests_ecma_3_RegExp_perlstress*']
|
|
|
|
|
2015-04-25 13:51:51 +03:00
|
|
|
systemProperty 'java.awt.headless', 'true'
|
|
|
|
systemProperty 'mozilla.js.tests', 'testsrc/tests'
|
|
|
|
systemProperty 'mozilla.js.tests.timeout', 60000
|
|
|
|
systemProperty 'user.language', 'en'
|
|
|
|
systemProperty 'user.country', 'US'
|
|
|
|
systemProperty 'user.timezone', 'America/Los_Angeles'
|
2015-08-19 22:22:50 +03:00
|
|
|
systemProperty 'file.encoding', 'UTF-8'
|
2020-12-06 03:41:15 +03:00
|
|
|
if (System.getProperty('quick') != null) {
|
|
|
|
systemProperty 'TEST_OPTLEVEL', -1
|
2021-05-19 18:54:05 +03:00
|
|
|
} else if (System.getProperty('optLevel')) {
|
|
|
|
systemProperty 'TEST_OPTLEVEL', System.getProperty('optLevel')
|
2020-12-06 03:41:15 +03:00
|
|
|
}
|
2021-05-19 16:20:10 +03:00
|
|
|
systemProperty 'test262properties', System.getProperty('test262properties')
|
2021-06-24 23:45:25 +03:00
|
|
|
if (System.getProperty('updateTest262properties') != null) {
|
|
|
|
systemProperty 'updateTest262properties', System.getProperty('updateTest262properties')
|
|
|
|
}
|
2018-11-15 22:42:09 +03:00
|
|
|
maxHeapSize = "1g"
|
2015-04-25 08:52:10 +03:00
|
|
|
testLogging.showStandardStreams = true
|
2017-11-17 20:23:03 +03:00
|
|
|
// Many tests do not clean up contexts properly. This makes the tests much
|
|
|
|
// more resilient at the expense of performance.
|
|
|
|
forkEvery = 1
|
2021-05-14 04:04:14 +03:00
|
|
|
maxParallelForks = 64
|
2015-04-25 08:52:10 +03:00
|
|
|
}
|
|
|
|
|
2016-02-20 00:44:00 +03:00
|
|
|
task sunSpiderBenchmark(type: JavaExec) {
|
2020-06-10 01:10:27 +03:00
|
|
|
classpath = sourceSets.jmh.runtimeClasspath
|
2021-10-09 15:56:50 +03:00
|
|
|
mainClass = 'org.openjdk.jmh.Main'
|
2023-08-19 02:07:59 +03:00
|
|
|
args '-f', '1', '-bm', 'avgt', 'SunSpider'
|
2016-02-20 00:44:00 +03:00
|
|
|
}
|
|
|
|
|
2020-06-10 01:10:27 +03:00
|
|
|
task v8Benchmark(type: JavaExec) {
|
|
|
|
classpath = sourceSets.jmh.runtimeClasspath
|
2021-10-09 15:56:50 +03:00
|
|
|
mainClass = 'org.openjdk.jmh.Main'
|
2021-02-24 05:01:44 +03:00
|
|
|
args '-f', '1', '-i', '10', '-bm', 'avgt', '-tu', 'us', 'V8'
|
2015-04-25 13:51:51 +03:00
|
|
|
}
|
2017-09-22 20:13:00 +03:00
|
|
|
|
|
|
|
task testBenchmark() {}
|
2016-02-20 00:44:00 +03:00
|
|
|
testBenchmark.dependsOn sunSpiderBenchmark
|
2017-09-22 20:13:00 +03:00
|
|
|
testBenchmark.dependsOn v8Benchmark
|
2015-04-25 08:52:10 +03:00
|
|
|
|
2021-05-13 03:18:27 +03:00
|
|
|
task microBenchmark(type: JavaExec, description: 'JMH micro benchmark') {
|
|
|
|
def benchmark = System.getProperty('benchmark')
|
|
|
|
if (benchmark == null) {
|
|
|
|
benchmark = "MathBenchmark"
|
|
|
|
}
|
|
|
|
classpath = sourceSets.jmh.runtimeClasspath
|
2021-10-09 15:56:50 +03:00
|
|
|
mainClass = 'org.openjdk.jmh.Main'
|
2021-05-13 03:18:27 +03:00
|
|
|
args '-f', '1', '-bm', 'avgt', '-tu', 'ns', '-r', '5', benchmark
|
|
|
|
}
|
|
|
|
|
|
|
|
task listBenchmarks(type: JavaExec, description: 'JMH benchmarks') {
|
2020-06-10 01:10:27 +03:00
|
|
|
classpath = sourceSets.jmh.runtimeClasspath
|
2021-10-09 15:56:50 +03:00
|
|
|
mainClass = 'org.openjdk.jmh.Main'
|
2021-05-13 03:18:27 +03:00
|
|
|
args '-lp'
|
2020-06-10 01:10:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
task jmhHelp(type: JavaExec, description: 'JMH benchmarks') {
|
|
|
|
classpath = sourceSets.jmh.runtimeClasspath
|
2021-10-09 15:56:50 +03:00
|
|
|
mainClass = 'org.openjdk.jmh.Main'
|
2020-06-10 01:10:27 +03:00
|
|
|
args '-help'
|
2016-02-18 07:35:16 +03:00
|
|
|
}
|
|
|
|
|
2015-04-25 13:51:51 +03:00
|
|
|
idea {
|
|
|
|
module {
|
|
|
|
excludeDirs += file('testsrc/tests/src')
|
|
|
|
excludeDirs += file('buildGradle')
|
|
|
|
excludeDirs += file('build')
|
|
|
|
excludeDirs += file('.idea')
|
|
|
|
excludeDirs += file('lib')
|
|
|
|
}
|
|
|
|
}
|
2015-04-26 00:43:10 +03:00
|
|
|
|
2021-12-12 20:51:38 +03:00
|
|
|
tasks.withType(AbstractArchiveTask).configureEach {
|
|
|
|
// Reproducible jar files
|
|
|
|
preserveFileTimestamps = false
|
|
|
|
reproducibleFileOrder = true
|
|
|
|
}
|
|
|
|
|
2020-01-13 22:21:14 +03:00
|
|
|
task runtimeJar(type: Jar) {
|
|
|
|
dependsOn compileJava
|
|
|
|
archiveBaseName = 'rhino-runtime'
|
2020-06-06 00:38:28 +03:00
|
|
|
from sourceSets.main.output
|
2021-12-12 20:51:38 +03:00
|
|
|
from ('LICENSE.txt') {
|
|
|
|
into 'META-INF'
|
|
|
|
}
|
|
|
|
from ('NOTICE.txt') {
|
|
|
|
into 'META-INF'
|
|
|
|
}
|
2020-06-06 00:38:28 +03:00
|
|
|
excludes = ["org/mozilla/javascript/tools", "org/mozilla/javascript/engine/**", "META-INF/services/**"]
|
2020-01-13 22:21:14 +03:00
|
|
|
manifest {
|
|
|
|
attributes(
|
|
|
|
"Manifest-Version": "1.0",
|
|
|
|
"Implementation-Version": project.version,
|
|
|
|
"Implementation-Title": "Mozilla Rhino",
|
|
|
|
"Implementation-Vendor": "Mozilla Foundation",
|
|
|
|
"Implementation-URL": "http://www.mozilla.org/rhino",
|
|
|
|
"Bundle-ManifestVersion": "2",
|
|
|
|
"Bundle-SymbolicName": "org.mozilla.rhino-runtime",
|
|
|
|
"Bundle-Version": project.version.replaceAll("-.*", ""),
|
2022-01-24 21:18:14 +03:00
|
|
|
"Export-Package": "org.mozilla.javascript,org.mozilla.javascript.ast,org.mozilla.javascript.annotations",
|
|
|
|
"Import-Package": "javax.lang.model,javax.script"
|
2020-01-13 22:21:14 +03:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-06 00:38:28 +03:00
|
|
|
task engineJar(type: Jar) {
|
|
|
|
dependsOn compileJava
|
|
|
|
archiveBaseName = 'rhino-engine'
|
|
|
|
from (sourceSets.main.output) {
|
|
|
|
include 'org/mozilla/javascript/engine/**'
|
|
|
|
include 'META-INF/services/**'
|
|
|
|
}
|
2021-12-12 20:51:38 +03:00
|
|
|
from ('LICENSE.txt') {
|
|
|
|
into 'META-INF'
|
|
|
|
}
|
2020-06-06 00:38:28 +03:00
|
|
|
manifest {
|
|
|
|
attributes(
|
|
|
|
"Manifest-Version": "1.0",
|
|
|
|
"Implementation-Version": project.version,
|
|
|
|
"Implementation-Title": "Mozilla Rhino ScriptEngine",
|
|
|
|
"Implementation-Vendor": "Mozilla Foundation",
|
|
|
|
"Implementation-URL": "http://www.mozilla.org/rhino",
|
2021-04-24 22:08:22 +03:00
|
|
|
"Automatic-Module-Name": "org.mozilla.rhino.engine"
|
2020-06-06 00:38:28 +03:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-26 16:38:45 +03:00
|
|
|
jar {
|
2022-01-05 21:00:42 +03:00
|
|
|
dependsOn compileJava
|
2021-12-12 20:51:38 +03:00
|
|
|
from ('LICENSE.txt') {
|
|
|
|
into 'META-INF'
|
|
|
|
}
|
|
|
|
from ('NOTICE.txt') {
|
|
|
|
into 'META-INF'
|
|
|
|
}
|
2022-01-05 21:00:42 +03:00
|
|
|
from ('NOTICE-tools.txt') {
|
|
|
|
into 'META-INF'
|
|
|
|
}
|
|
|
|
from sourceSets.main.output
|
2020-06-06 00:38:28 +03:00
|
|
|
excludes = ["org/mozilla/javascript/engine/**", "META-INF/services/**"]
|
2021-12-12 20:51:38 +03:00
|
|
|
// Class ImplementationVersion uses 'Implementation-Title'
|
2015-04-26 16:38:45 +03:00
|
|
|
manifest {
|
|
|
|
attributes(
|
|
|
|
"Manifest-Version": "1.0",
|
|
|
|
"Main-Class": "org.mozilla.javascript.tools.shell.Main",
|
|
|
|
"Implementation-Version": project.version,
|
|
|
|
"Implementation-Title": "Mozilla Rhino",
|
|
|
|
"Implementation-Vendor": "Mozilla Foundation",
|
2015-05-03 15:18:04 +03:00
|
|
|
"Implementation-URL": "http://www.mozilla.org/rhino",
|
2021-04-24 22:08:22 +03:00
|
|
|
"Automatic-Module-Name": "org.mozilla.rhino",
|
2019-05-31 00:14:36 +03:00
|
|
|
"Bundle-ManifestVersion": "2",
|
|
|
|
"Bundle-SymbolicName": "org.mozilla.rhino",
|
|
|
|
"Bundle-Version": project.version.replaceAll("-.*", ""),
|
2022-01-24 21:18:14 +03:00
|
|
|
"Export-Package": "org.mozilla.javascript,org.mozilla.javascript.ast,org.mozilla.javascript.annotations",
|
|
|
|
"Import-Package": "javax.lang.model,javax.script"
|
2015-04-26 16:38:45 +03:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-09 21:39:34 +03:00
|
|
|
javadoc {
|
|
|
|
options.addBooleanOption("-allow-script-in-comments", true)
|
|
|
|
options.addStringOption('Xdoclint:html', '-quiet')
|
2015-04-26 00:43:10 +03:00
|
|
|
}
|
|
|
|
|
2018-04-09 21:39:34 +03:00
|
|
|
task javadocJar(type: Jar) {
|
2021-12-12 20:51:38 +03:00
|
|
|
archiveClassifier = 'javadoc'
|
2018-04-09 21:39:34 +03:00
|
|
|
from javadoc
|
2015-04-26 00:43:10 +03:00
|
|
|
}
|
|
|
|
|
2020-01-13 22:21:14 +03:00
|
|
|
task runtimeJavadocJar(type: Jar) {
|
2021-12-12 20:51:38 +03:00
|
|
|
archiveClassifier = 'javadoc'
|
2020-01-13 22:21:14 +03:00
|
|
|
from javadoc
|
2020-06-06 00:38:28 +03:00
|
|
|
exclude 'org/mozilla/javascript/tools', 'org/mozilla/javascript/engine'
|
|
|
|
}
|
|
|
|
|
|
|
|
task engineJavadocJar(type: Jar) {
|
2021-12-12 20:51:38 +03:00
|
|
|
archiveClassifier = 'javadoc'
|
2020-06-06 00:38:28 +03:00
|
|
|
from javadoc
|
|
|
|
include 'org/mozilla/javascript/engine/**'
|
2020-01-13 22:21:14 +03:00
|
|
|
}
|
2018-04-09 21:39:34 +03:00
|
|
|
|
|
|
|
task sourceJar(type: Jar) {
|
|
|
|
from sourceSets.main.allJava
|
2022-01-05 21:00:42 +03:00
|
|
|
archiveClassifier = 'sources'
|
2021-12-12 20:51:38 +03:00
|
|
|
from ('LICENSE.txt') {
|
|
|
|
into 'META-INF'
|
|
|
|
}
|
|
|
|
from ('NOTICE.txt') {
|
|
|
|
into 'META-INF'
|
|
|
|
}
|
2022-01-05 21:00:42 +03:00
|
|
|
from ('NOTICE-tools.txt') {
|
|
|
|
into 'META-INF'
|
|
|
|
}
|
2015-04-26 00:43:10 +03:00
|
|
|
}
|
|
|
|
|
2020-01-13 22:21:14 +03:00
|
|
|
task runtimeSourceJar(type: Jar) {
|
2021-12-12 20:51:38 +03:00
|
|
|
archiveClassifier = 'sources'
|
2020-01-13 22:21:14 +03:00
|
|
|
from sourceSets.main.allJava
|
2020-06-06 00:38:28 +03:00
|
|
|
exclude 'org/mozilla/javascript/tools', 'org/mozilla/javascript/engine'
|
2021-12-12 20:51:38 +03:00
|
|
|
from ('LICENSE.txt') {
|
|
|
|
into 'META-INF'
|
|
|
|
}
|
|
|
|
from ('NOTICE.txt') {
|
|
|
|
into 'META-INF'
|
|
|
|
}
|
2020-06-06 00:38:28 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
task engineSourceJar(type: Jar) {
|
2021-12-12 20:51:38 +03:00
|
|
|
archiveClassifier = 'sources'
|
2020-06-06 00:38:28 +03:00
|
|
|
from sourceSets.main.allJava
|
|
|
|
include 'org/mozilla/javascript/engine/**'
|
2021-12-12 20:51:38 +03:00
|
|
|
from ('LICENSE.txt') {
|
|
|
|
into 'META-INF'
|
|
|
|
}
|
2020-01-13 22:21:14 +03:00
|
|
|
}
|
2018-04-09 21:39:34 +03:00
|
|
|
|
2015-04-26 00:43:10 +03:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
rhino(MavenPublication) {
|
2015-07-25 01:01:12 +03:00
|
|
|
groupId 'org.mozilla'
|
|
|
|
artifactId 'rhino'
|
2022-01-05 21:00:42 +03:00
|
|
|
artifacts = [jar, sourceJar, javadocJar]
|
2015-07-25 01:10:10 +03:00
|
|
|
|
2015-04-26 00:43:10 +03:00
|
|
|
pom.withXml {
|
|
|
|
def root = asNode()
|
|
|
|
|
|
|
|
root.appendNode('description', """
|
|
|
|
Rhino is an open-source implementation of JavaScript written entirely in Java.
|
|
|
|
It is typically embedded into Java applications to provide scripting to end users.
|
2021-12-12 20:51:38 +03:00
|
|
|
Full jar including tools, excluding the JSR-223 Script Engine wrapper.
|
2015-04-26 00:43:10 +03:00
|
|
|
""")
|
2021-12-12 20:51:38 +03:00
|
|
|
root.appendNode("url", "https://mozilla.github.io/rhino/")
|
2015-04-26 00:43:10 +03:00
|
|
|
|
2015-07-25 01:10:10 +03:00
|
|
|
def p = root.appendNode("parent")
|
|
|
|
p.appendNode("groupId", "org.sonatype.oss")
|
|
|
|
p.appendNode("artifactId", "oss-parent")
|
|
|
|
p.appendNode("version", "7")
|
|
|
|
|
2015-04-26 00:43:10 +03:00
|
|
|
def l = root.appendNode("licenses").appendNode("license")
|
|
|
|
l.appendNode("name", "Mozilla Public License, Version 2.0")
|
|
|
|
l.appendNode("url", "http://www.mozilla.org/MPL/2.0/index.txt")
|
|
|
|
|
|
|
|
def scm = root.appendNode("scm")
|
|
|
|
scm.appendNode("connection", "scm:git:git@github.com:mozilla/rhino.git")
|
|
|
|
scm.appendNode("developerConnection", "scm:git:git@github.com:mozilla/rhino.git")
|
|
|
|
scm.appendNode("url", "git@github.com:mozilla/rhino.git")
|
|
|
|
|
|
|
|
def o = root.appendNode("organization")
|
|
|
|
o.appendNode("name", "The Mozilla Foundation")
|
|
|
|
o.appendNode("url", "http://www.mozilla.org")
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2020-01-13 22:21:14 +03:00
|
|
|
|
|
|
|
rhinoruntime(MavenPublication) {
|
|
|
|
groupId 'org.mozilla'
|
|
|
|
artifactId 'rhino-runtime'
|
|
|
|
artifacts = [runtimeJar, runtimeSourceJar, runtimeJavadocJar]
|
|
|
|
|
|
|
|
pom.withXml {
|
|
|
|
def root = asNode()
|
|
|
|
|
|
|
|
root.appendNode('description', """
|
2021-12-12 20:51:38 +03:00
|
|
|
Rhino JavaScript runtime jar, excludes tools & JSR-223 Script Engine wrapper.
|
2020-01-13 22:21:14 +03:00
|
|
|
""")
|
2021-12-12 20:51:38 +03:00
|
|
|
root.appendNode("url", "https://mozilla.github.io/rhino/")
|
2020-01-13 22:21:14 +03:00
|
|
|
|
|
|
|
def p = root.appendNode("parent")
|
|
|
|
p.appendNode("groupId", "org.sonatype.oss")
|
|
|
|
p.appendNode("artifactId", "oss-parent")
|
|
|
|
p.appendNode("version", "7")
|
|
|
|
|
|
|
|
def l = root.appendNode("licenses").appendNode("license")
|
|
|
|
l.appendNode("name", "Mozilla Public License, Version 2.0")
|
|
|
|
l.appendNode("url", "http://www.mozilla.org/MPL/2.0/index.txt")
|
|
|
|
|
|
|
|
def scm = root.appendNode("scm")
|
|
|
|
scm.appendNode("connection", "scm:git:git@github.com:mozilla/rhino.git")
|
|
|
|
scm.appendNode("developerConnection", "scm:git:git@github.com:mozilla/rhino.git")
|
|
|
|
scm.appendNode("url", "git@github.com:mozilla/rhino.git")
|
|
|
|
|
|
|
|
def o = root.appendNode("organization")
|
|
|
|
o.appendNode("name", "The Mozilla Foundation")
|
|
|
|
o.appendNode("url", "http://www.mozilla.org")
|
|
|
|
}
|
|
|
|
}
|
2020-06-06 00:38:28 +03:00
|
|
|
|
|
|
|
rhinoengine(MavenPublication) {
|
|
|
|
groupId 'org.mozilla'
|
|
|
|
artifactId 'rhino-engine'
|
|
|
|
artifacts = [engineJar, engineSourceJar, engineJavadocJar]
|
|
|
|
|
|
|
|
pom.withXml {
|
|
|
|
def root = asNode()
|
|
|
|
|
|
|
|
root.appendNode('description', """
|
2021-12-12 20:51:38 +03:00
|
|
|
Rhino Javascript JSR-223 Script Engine wrapper.
|
2020-06-06 00:38:28 +03:00
|
|
|
""")
|
2021-12-12 20:51:38 +03:00
|
|
|
root.appendNode("url", "https://mozilla.github.io/rhino/")
|
2020-06-06 00:38:28 +03:00
|
|
|
|
|
|
|
def p = root.appendNode("parent")
|
|
|
|
p.appendNode("groupId", "org.sonatype.oss")
|
|
|
|
p.appendNode("artifactId", "oss-parent")
|
|
|
|
p.appendNode("version", "7")
|
|
|
|
|
|
|
|
def l = root.appendNode("licenses").appendNode("license")
|
|
|
|
l.appendNode("name", "Mozilla Public License, Version 2.0")
|
|
|
|
l.appendNode("url", "http://www.mozilla.org/MPL/2.0/index.txt")
|
|
|
|
|
|
|
|
def scm = root.appendNode("scm")
|
|
|
|
scm.appendNode("connection", "scm:git:git@github.com:mozilla/rhino.git")
|
|
|
|
scm.appendNode("developerConnection", "scm:git:git@github.com:mozilla/rhino.git")
|
|
|
|
scm.appendNode("url", "git@github.com:mozilla/rhino.git")
|
|
|
|
|
|
|
|
def o = root.appendNode("organization")
|
|
|
|
o.appendNode("name", "The Mozilla Foundation")
|
|
|
|
o.appendNode("url", "http://www.mozilla.org")
|
|
|
|
|
|
|
|
def deps = root.appendNode("dependencies")
|
|
|
|
def rhino = deps.appendNode("dependency")
|
|
|
|
rhino.appendNode("groupId", "org.mozilla")
|
|
|
|
rhino.appendNode("artifactId", "rhino")
|
|
|
|
rhino.appendNode("version", getVersion())
|
|
|
|
}
|
|
|
|
}
|
2015-04-26 00:43:10 +03:00
|
|
|
}
|
|
|
|
|
2015-04-29 19:39:05 +03:00
|
|
|
if (project.hasProperty("mavenPassword")) {
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
credentials {
|
|
|
|
username mavenUser
|
|
|
|
password mavenPassword
|
|
|
|
}
|
|
|
|
if (project.version.endsWith('-SNAPSHOT')) {
|
|
|
|
url mavenSnapshotRepo
|
|
|
|
} else {
|
|
|
|
url mavenReleaseRepo
|
|
|
|
}
|
2015-04-26 00:43:10 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-09-01 20:30:56 +03:00
|
|
|
}
|
|
|
|
|
2020-09-02 20:32:02 +03:00
|
|
|
signing {
|
2022-01-05 02:45:13 +03:00
|
|
|
if (project.hasProperty('SIGNINGKEY')) {
|
2022-01-05 21:00:42 +03:00
|
|
|
// Check for ORG_GRADLE_PROJECT_SIGNINGKEY environment variable for use in CI system.
|
|
|
|
// Otherwise, do not sign.
|
|
|
|
def signingKey = getProperty('SIGNINGKEY')
|
|
|
|
def signingPassword = getProperty('SIGNINGPASSWORD')
|
|
|
|
useInMemoryPgpKeys(signingKey, signingPassword)
|
|
|
|
sign publishing.publications.rhino
|
|
|
|
sign publishing.publications.rhinoengine
|
|
|
|
sign publishing.publications.rhinoruntime
|
2022-01-05 02:45:13 +03:00
|
|
|
}
|
2020-09-02 20:32:02 +03:00
|
|
|
}
|
|
|
|
|
2019-10-15 00:25:58 +03:00
|
|
|
spotbugs {
|
2020-06-19 02:45:30 +03:00
|
|
|
effort = "less"
|
|
|
|
reportLevel = "medium"
|
2019-10-15 00:25:58 +03:00
|
|
|
excludeFilter = file("./spotbugs-exclude.xml")
|
|
|
|
}
|
|
|
|
|
2021-04-15 20:30:41 +03:00
|
|
|
spotless {
|
|
|
|
java {
|
|
|
|
googleJavaFormat().aosp()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-19 18:22:49 +03:00
|
|
|
if (JavaVersion.current() > JavaVersion.VERSION_15
|
|
|
|
&& (!System.properties.containsKey('org.gradle.jvmargs')
|
|
|
|
|| !System.properties.get('org.gradle.jvmargs').contains('com.sun.tools.javac.api'))
|
|
|
|
&& (!project.hasProperty('org.gradle.jvmargs')
|
|
|
|
|| !project.property('org.gradle.jvmargs').contains('com.sun.tools.javac.api'))) {
|
|
|
|
tasks.named('check') {
|
|
|
|
doFirst {
|
|
|
|
logger.warn('WARNING: spotless plugin removed from check due to bug, ' + \
|
|
|
|
'see README for a workaround when building with Java 16+.')
|
|
|
|
}
|
2021-09-25 17:39:05 +03:00
|
|
|
}
|
2021-10-19 18:22:49 +03:00
|
|
|
spotless.enforceCheck false
|
2021-09-25 17:39:05 +03:00
|
|
|
}
|
|
|
|
|
2015-09-01 20:30:56 +03:00
|
|
|
jacocoTestReport {
|
2021-10-19 18:22:49 +03:00
|
|
|
dependsOn test
|
2015-09-01 20:30:56 +03:00
|
|
|
reports {
|
2021-10-09 15:56:50 +03:00
|
|
|
csv.required = true
|
|
|
|
html.required = true
|
2015-09-01 20:30:56 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-28 22:20:37 +03:00
|
|
|
checkstyle {
|
|
|
|
configFile = file("${projectDir}/checkstyle.xml")
|
2020-06-06 00:38:28 +03:00
|
|
|
sourceSets = [ project.sourceSets.main ]
|
2017-07-28 22:20:37 +03:00
|
|
|
}
|
2016-02-03 22:30:05 +03:00
|
|
|
|
2015-09-01 20:30:56 +03:00
|
|
|
distributions {
|
|
|
|
main {
|
|
|
|
contents {
|
2017-09-27 00:17:02 +03:00
|
|
|
from(sourceSets.main.java) {
|
2016-02-03 22:30:05 +03:00
|
|
|
into 'rhino' + project.version + '/src'
|
2015-09-01 20:30:56 +03:00
|
|
|
}
|
2017-09-27 00:17:02 +03:00
|
|
|
from(sourceSets.main.resources) {
|
|
|
|
exclude '**/*.java'
|
|
|
|
into 'rhino' + project.version + '/src'
|
|
|
|
}
|
2015-09-01 20:30:56 +03:00
|
|
|
from(javadoc.destinationDir) {
|
2016-02-03 22:30:05 +03:00
|
|
|
into 'rhino' + project.version + '/docs'
|
2015-09-01 20:30:56 +03:00
|
|
|
}
|
|
|
|
from(jar.outputs.files) {
|
2016-02-03 22:30:05 +03:00
|
|
|
into 'rhino' + project.version + '/lib'
|
2015-09-01 20:30:56 +03:00
|
|
|
}
|
2021-12-12 20:51:38 +03:00
|
|
|
from(runtimeJar.outputs.files) {
|
|
|
|
into 'rhino' + project.version + '/lib'
|
|
|
|
}
|
|
|
|
from(engineJar.outputs.files) {
|
|
|
|
into 'rhino' + project.version + '/lib'
|
2017-09-26 22:44:40 +03:00
|
|
|
}
|
2015-09-01 20:30:56 +03:00
|
|
|
from(file(".")) {
|
2021-12-12 20:51:38 +03:00
|
|
|
include '*.txt', '*.md', 'build.gradle', 'gradle.properties',
|
|
|
|
'gradle/**', 'gradlew', 'man/*.1'
|
2016-02-03 22:30:05 +03:00
|
|
|
into 'rhino' + project.version
|
2015-09-01 20:30:56 +03:00
|
|
|
}
|
|
|
|
into "/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-12 20:51:38 +03:00
|
|
|
distTar {
|
|
|
|
dependsOn javadoc, jar
|
|
|
|
compression = Compression.GZIP
|
|
|
|
archiveExtension = 'tar.gz'
|
|
|
|
}
|
|
|
|
|
2020-01-13 23:38:07 +03:00
|
|
|
distZip.dependsOn javadoc, jar, sourceJar, runtimeSourceJar
|