| @@ -16,12 +16,12 | |||||
| 16 | </natures> |
|
16 | </natures> | |
| 17 | <filteredResources> |
|
17 | <filteredResources> | |
| 18 | <filter> |
|
18 | <filter> | |
| 19 |
<id>1 |
|
19 | <id>1678653378261</id> | |
| 20 | <name></name> |
|
20 | <name></name> | |
| 21 | <type>30</type> |
|
21 | <type>30</type> | |
| 22 | <matcher> |
|
22 | <matcher> | |
| 23 | <id>org.eclipse.core.resources.regexFilterMatcher</id> |
|
23 | <id>org.eclipse.core.resources.regexFilterMatcher</id> | |
| 24 | <arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments> |
|
24 | <arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments> | |
| 25 | </matcher> |
|
25 | </matcher> | |
| 26 | </filter> |
|
26 | </filter> | |
| 27 | </filteredResources> |
|
27 | </filteredResources> | |
| @@ -1,11 +1,11 | |||||
| 1 | arguments= |
|
1 | arguments=--init-script /home/sergey/.config/Code/User/globalStorage/redhat.java/1.21.0/config_linux/org.eclipse.osgi/51/0/.cp/gradle/init/init.gradle --init-script /home/sergey/.config/Code/User/globalStorage/redhat.java/1.21.0/config_linux/org.eclipse.osgi/51/0/.cp/gradle/protobuf/init.gradle | |
| 2 | auto.sync=false |
|
2 | auto.sync=false | |
| 3 | build.scans.enabled=false |
|
3 | build.scans.enabled=false | |
| 4 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) |
|
4 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) | |
| 5 | connection.project.dir= |
|
5 | connection.project.dir= | |
| 6 | eclipse.preferences.version=1 |
|
6 | eclipse.preferences.version=1 | |
| 7 | gradle.user.home= |
|
7 | gradle.user.home= | |
| 8 | java.home=/usr/lib64/jvm/java |
|
8 | java.home=/usr/lib64/jvm/java-11-openjdk-11 | |
| 9 | jvm.arguments= |
|
9 | jvm.arguments= | |
| 10 | offline.mode=false |
|
10 | offline.mode=false | |
| 11 | override.workspace.settings=true |
|
11 | override.workspace.settings=true | |
| @@ -1,224 +1,97 | |||||
| 1 | plugins { |
|
1 | plugins { | |
| 2 |
id "org.implab.gradle-typescript" |
|
2 | id "org.implab.gradle-typescript" | |
| 3 |
id "org.implab.gradle- |
|
3 | id "org.implab.gradle-npm-package" | |
| 4 | id "ivy-publish" |
|
4 | id "ivy-publish" | |
| 5 | } |
|
5 | } | |
| 6 |
|
6 | |||
| 7 | if (!symbols in ['local', 'pack', 'none']) |
|
7 | typescript { | |
| 8 | throw new Exception("The symbols property value is invalid: $symbols"); |
|
8 | useTsc npm.bin("tsc") | |
| 9 |
|
||||
| 10 | if (!flavour in ['browser', 'node']) |
|
|||
| 11 | throw new Exception("The flavour property value is invalid: $flavour"); |
|
|||
| 12 |
|
||||
| 13 | ext { |
|
|||
| 14 | packageName = flavour == 'browser' ? "@$npmScope/$name-amd" : "@$npmScope/$name" |
|
|||
| 15 | lint = project.hasProperty('lint') ? project.lint ?: true : false |
|
|||
| 16 | } |
|
|||
| 17 |
|
9 | |||
| 18 | sources { |
|
10 | compilerOptions { | |
| 19 | amd { |
|
11 | incremental = true | |
| 20 | typings { |
|
|||
| 21 | srcDir main.output.typingsDir |
|
|||
| 22 | } |
|
|||
| 23 | } |
|
|||
| 24 |
|
||||
| 25 | cjs { |
|
|||
| 26 | typings { |
|
|||
| 27 | srcDir main.output.typingsDir |
|
|||
| 28 | } |
|
|||
| 29 | } |
|
|||
| 30 |
|
||||
| 31 | testAmd { |
|
|||
| 32 | typings { |
|
|||
| 33 | srcDir main.output.typingsDir |
|
|||
| 34 | srcDir amd.output.typingsDir |
|
|||
| 35 | srcDir test.output.typingsDir |
|
|||
| 36 |
|
|
12 | } | |
| 37 | } |
|
13 | } | |
| 38 |
|
14 | |||
| 39 | testCjs { |
|
15 | def typingsFromMain = { | |
| 40 | typings { |
|
16 | sets { | |
| 41 | srcDir main.output.typingsDir |
|
17 | named("compileOnlyTypings") { | |
| 42 |
srcDir |
|
18 | srcDir main.output("typings") | |
| 43 | srcDir test.output.typingsDir |
|
|||
| 44 | } |
|
|||
| 45 | } |
|
|||
| 46 | } |
|
|||
| 47 |
|
||||
| 48 | typescript { |
|
|||
| 49 | compilerOptions { |
|
|||
| 50 | types = [] |
|
|||
| 51 | declaration = true |
|
|||
| 52 | experimentalDecorators = true |
|
|||
| 53 | strict = true |
|
|||
| 54 | // dojo-typings are sick |
|
|||
| 55 | skipLibCheck = true |
|
|||
| 56 |
|
||||
| 57 | if(symbols != 'none') { |
|
|||
| 58 | sourceMap = true |
|
|||
| 59 | sourceRoot = "pack:${packageName}" |
|
|||
| 60 | } |
|
|||
| 61 |
|
||||
| 62 | if (flavour == 'node') { |
|
|||
| 63 | module = "commonjs" |
|
|||
| 64 | target = "es2017" |
|
|||
| 65 | lib = ["es2017", "dom", "scripthost"] |
|
|||
| 66 | } else if (flavour == 'browser') { |
|
|||
| 67 | module = "amd" |
|
|||
| 68 | target = "es5" |
|
|||
| 69 | lib = ["es5", "dom", "scripthost", "es2015.promise", "es2015.symbol", "es2015.iterable" ] |
|
|||
| 70 | } |
|
|||
| 71 | } |
|
|||
| 72 | tscCmd = "$projectDir/node_modules/.bin/tsc" |
|
|||
| 73 | tsLintCmd = "$projectDir/node_modules/.bin/tslint" |
|
|||
| 74 | esLintCmd = "$projectDir/node_modules/.bin/eslint" |
|
|||
| 75 | } |
|
|||
| 76 |
|
||||
| 77 | tasks.matching{ it.name =~ /^lint/ }.configureEach { |
|
|||
| 78 | onlyIf { lint } |
|
|||
| 79 | } |
|
|||
| 80 |
|
||||
| 81 | if (symbols == 'local') { |
|
|||
| 82 | tasks.matching{ it.name =~ /^configureTs/ }.configureEach { |
|
|||
| 83 | compilerOptions { |
|
|||
| 84 | sourceRoot = "file://" + it.rootDir |
|
|||
| 85 | } |
|
19 | } | |
| 86 | } |
|
20 | } | |
| 87 | } |
|
21 | } | |
| 88 |
|
22 | |||
| 89 | task printVersion { |
|
23 | variants { | |
| 90 | doLast { |
|
24 | configureEach { variant -> | |
| 91 | println "packageName: $packageName"; |
|
25 | def sourceSetLocation = { setName, self -> | |
| 92 | println "version: $version"; |
|
26 | self.sourceSetDir = layout.projectDirectory.dir("src/${setName}") | |
| 93 | println "flavour: $flavour"; |
|
27 | self.outputsDir = layout.buildDirectory.dir("${variant.name}/${setName}") | |
| 94 | println "target: $typescript.compilerOptions.target"; |
|
|||
| 95 | println "module: $typescript.compilerOptions.module"; |
|
|||
| 96 | println "lint: $lint"; |
|
|||
| 97 | println "symbols: $symbols"; |
|
|||
| 98 | } |
|
|||
| 99 | } |
|
28 | } | |
| 100 |
|
29 | |||
| 101 | npmPackMeta { |
|
30 | def main = sources.register("${variant.name}Main", sourceSetLocation.curry("main")) | |
| 102 | meta { |
|
31 | def test = sources.register("${variant.name}Test", sourceSetLocation.curry("test")) | |
| 103 | name = packageName |
|
32 | ||
| 104 | } |
|
33 | sourceSets { | |
|
|
34 | add(main) { | |||
|
|
35 | role "main" | |||
| 105 | } |
|
36 | } | |
| 106 |
|
37 | add(test) { | ||
| 107 | configureTsCjs { |
|
38 | role "test" | |
| 108 | dependsOn sources.main.output |
|
|||
| 109 | compilerOptions { |
|
|||
| 110 | types += [ "node" ] |
|
|||
| 111 | } |
|
39 | } | |
| 112 | } |
|
40 | } | |
|
|
41 | } | |||
|
|
42 | register("browser") { | |||
|
|
43 | def srcAmd = sources.register("amd", typingsFromMain) | |||
|
|
44 | def srcTestAmd = sources.register("testAmd", typingsFromMain) | |||
| 113 |
|
45 | |||
| 114 | configureTsAmd { |
|
46 | // advice to all TypescriptCompile tasks | |
| 115 | dependsOn sources.main.output |
|
47 | typescriptCompile { | |
| 116 | compilerOptions { |
|
48 | baseTsConfig = file("src/tsconfig.browser.json") | |
| 117 | types += [ "requirejs", "dojo-typings" ] |
|
|||
| 118 | } |
|
|||
| 119 | } |
|
49 | } | |
| 120 |
|
50 | |||
| 121 | test { |
|
51 | // creates npmPackBrowser, npmPublishBrowser | |
| 122 | workingDir layout.buildDirectory.dir("test"); |
|
52 | npmPackage { | |
| 123 | commandLine "node", "tests/index.js" |
|
53 | usePackageJson() | |
|
|
54 | metadata { | |||
|
|
55 | name = "@implab/core-amd" | |||
| 124 | } |
|
56 | } | |
| 125 |
|
57 | content { | ||
| 126 | assemble { |
|
58 | from sourceSets.byRoles("main").allOutputs() | |
| 127 | if (flavour == 'browser') { |
|
|||
| 128 | dependsOn sources.amd.output |
|
|||
| 129 | from sources.amd.output.compiledDir |
|
|||
| 130 | from sources.amd.resources |
|
|||
| 131 | } |
|
|||
| 132 | if (flavour == 'node') { |
|
|||
| 133 | dependsOn sources.cjs.output |
|
|||
| 134 | from sources.cjs.output.compiledDir |
|
|||
| 135 | from sources.cjs.resources |
|
|||
| 136 | } |
|
59 | } | |
| 137 | } |
|
60 | } | |
| 138 |
|
61 | |||
| 139 | assembleTest { |
|
62 | sourceSets { | |
| 140 | if (flavour == 'browser') { |
|
63 | add(srcAmd) { | |
| 141 | dependsOn sources.amd.output, sources.testAmd.output |
|
64 | role "main" | |
| 142 |
|
||||
| 143 | from sources.amd.output.compiledDir |
|
|||
| 144 | from sources.testAmd.output.compiledDir |
|
|||
| 145 | from sources.amd.resources |
|
|||
| 146 | from sources.testAmd.resources |
|
|||
| 147 | } |
|
65 | } | |
| 148 | if (flavour == 'node') { |
|
66 | add(srcTestAmd) { | |
| 149 | dependsOn sources.cjs.output, sources.testCjs.output |
|
67 | role "test" | |
| 150 |
|
68 | } | ||
| 151 | from sources.cjs.output.compiledDir |
|
|||
| 152 | from sources.testCjs.output.compiledDir |
|
|||
| 153 | from sources.cjs.resources |
|
|||
| 154 | from sources.testCjs.resources |
|
|||
| 155 | } |
|
69 | } | |
| 156 | } |
|
70 | } | |
|
|
71 | register("node") { | |||
|
|
72 | def srcCjs = sources.register("cjs", typingsFromMain) | |||
|
|
73 | def srcTestCjs = sources.register("testCjs", typingsFromMain) | |||
| 157 |
|
74 | |||
| 158 | typings { |
|
75 | compileTasks { | |
| 159 | if (flavour == 'browser') { |
|
76 | baseTsConfig = file("src/tsconfig.node.json") | |
| 160 | dependsOn sources.amd.output |
|
|||
| 161 | from sources.amd.output.typingsDir |
|
|||
| 162 | } |
|
77 | } | |
| 163 | if (flavour == 'node') { |
|
78 | ||
| 164 | dependsOn sources.cjs.output |
|
79 | npmPackage { | |
| 165 | from sources.cjs.output.typingsDir |
|
80 | name = "@implab/core" | |
|
|
81 | } | |||
|
|
82 | ||||
|
|
83 | sourceSets { | |||
|
|
84 | add srcAmd | |||
|
|
85 | add srcTestAmd | |||
| 166 | } |
|
86 | } | |
| 167 | } |
|
87 | } | |
| 168 |
|
88 | |||
| 169 | task npmPackTypings(type: Copy) { |
|
89 | npmPackage { | |
| 170 | npmPackContents.dependsOn it |
|
90 | usePackageJson() | |
| 171 | dependsOn sources.main.output |
|
91 | metadata { | |
| 172 |
|
92 | name = "@implab/core" | ||
| 173 | from sources.main.output.typingsDir |
|
93 | version = project.provider { project.version.toString() } | |
| 174 |
|
||||
| 175 | if (flavour == 'browser') { |
|
|||
| 176 | dependsOn sources.amd.output |
|
|||
| 177 | from sources.amd.output.typingsDir |
|
|||
| 178 | } |
|
|||
| 179 | if (flavour == 'node') { |
|
|||
| 180 | dependsOn sources.cjs.output |
|
|||
| 181 | from sources.cjs.output.typingsDir |
|
|||
| 182 | } |
|
|||
| 183 |
|
||||
| 184 | into npm.packageDir |
|
|||
| 185 | } |
|
|||
| 186 |
|
||||
| 187 | task npmPackSources(type: Copy) { |
|
|||
| 188 | from sources.main.ts |
|
|||
| 189 | if (symbols == 'pack') { |
|
|||
| 190 | npmPackContents.dependsOn npmPackSources |
|
|||
| 191 | } |
|
|||
| 192 |
|
||||
| 193 | if (flavour == 'browser') { |
|
|||
| 194 | from sources.amd.ts |
|
|||
| 195 | } |
|
94 | } | |
| 196 | if (flavour == 'node') { |
|
|||
| 197 | from sources.cjs.ts |
|
|||
| 198 | } |
|
|||
| 199 |
|
||||
| 200 | into npm.packageDir.dir("_src") |
|
|||
| 201 | } |
|
|||
| 202 |
|
||||
| 203 |
|
||||
| 204 |
|
||||
| 205 | task packJsTar(type: Tar) { |
|
|||
| 206 | dependsOn assemble; |
|
|||
| 207 |
|
||||
| 208 | archiveBaseName = provider { packageName } |
|
|||
| 209 |
|
||||
| 210 | destinationDirectory = buildDir |
|
|||
| 211 | archiveClassifier = provider { typescript.compilerOptions.module } |
|
|||
| 212 | compression = Compression.GZIP |
|
|||
| 213 |
|
||||
| 214 | from(assemble.outputs) |
|
|||
| 215 |
|
||||
| 216 | doLast { |
|
|||
| 217 | println archiveName; |
|
|||
| 218 | } |
|
|||
| 219 | } |
|
|||
| 220 |
|
||||
| 221 | task packTypingsTar(type: Tar) { |
|
|||
| 222 | } |
|
95 | } | |
| 223 |
|
96 | |||
| 224 | publishing { |
|
97 | publishing { | |
| @@ -1,9 +1,6 | |||||
| 1 | group=org.implab |
|
1 | group=org.implab | |
| 2 | version= |
|
2 | version= | |
| 3 | author=Implab team |
|
3 | ||
| 4 | description=Dependency injection, logging, simple and fast text processing tools |
|
4 | org.gradle.parallel=true | |
| 5 | license=BSD-2-Clause |
|
5 | org.gradle.configuration-cache.parallel=true | |
| 6 | repository=https://bitbucket.org/implab/implabjs-core |
|
6 | org.gradle.configuration-cache=true No newline at end of file | |
| 7 | npmScope=implab |
|
|||
| 8 | flavour=browser |
|
|||
| 9 | symbols=pack No newline at end of file |
|
|||
| 1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
| @@ -1,5 +1,7 | |||||
| 1 | distributionBase=GRADLE_USER_HOME |
|
1 | distributionBase=GRADLE_USER_HOME | |
| 2 | distributionPath=wrapper/dists |
|
2 | distributionPath=wrapper/dists | |
| 3 |
distributionUrl=https\://services.gradle.org/distributions/gradle- |
|
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip | |
|
|
4 | networkTimeout=10000 | |||
|
|
5 | validateDistributionUrl=true | |||
| 4 | zipStoreBase=GRADLE_USER_HOME |
|
6 | zipStoreBase=GRADLE_USER_HOME | |
| 5 | zipStorePath=wrapper/dists |
|
7 | zipStorePath=wrapper/dists | |
| @@ -1,7 +1,7 | |||||
| 1 |
#!/ |
|
1 | #!/bin/sh | |
| 2 |
|
2 | |||
| 3 | # |
|
3 | # | |
| 4 |
# Copyright 2015 the original |
|
4 | # Copyright © 2015 the original authors. | |
| 5 | # |
|
5 | # | |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
|
6 | # Licensed under the Apache License, Version 2.0 (the "License"); | |
| 7 | # you may not use this file except in compliance with the License. |
|
7 | # you may not use this file except in compliance with the License. | |
| @@ -15,80 +15,114 | |||||
| 15 | # See the License for the specific language governing permissions and |
|
15 | # See the License for the specific language governing permissions and | |
| 16 | # limitations under the License. |
|
16 | # limitations under the License. | |
| 17 | # |
|
17 | # | |
|
|
18 | # SPDX-License-Identifier: Apache-2.0 | |||
|
|
19 | # | |||
| 18 |
|
20 | |||
| 19 | ############################################################################## |
|
21 | ############################################################################## | |
| 20 |
# |
|
22 | # | |
| 21 |
# |
|
23 | # Gradle start up script for POSIX generated by Gradle. | |
| 22 |
# |
|
24 | # | |
|
|
25 | # Important for running: | |||
|
|
26 | # | |||
|
|
27 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is | |||
|
|
28 | # noncompliant, but you have some other compliant shell such as ksh or | |||
|
|
29 | # bash, then to run this script, type that shell name before the whole | |||
|
|
30 | # command line, like: | |||
|
|
31 | # | |||
|
|
32 | # ksh Gradle | |||
|
|
33 | # | |||
|
|
34 | # Busybox and similar reduced shells will NOT work, because this script | |||
|
|
35 | # requires all of these POSIX shell features: | |||
|
|
36 | # * functions; | |||
|
|
37 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», | |||
|
|
38 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; | |||
|
|
39 | # * compound commands having a testable exit status, especially «case»; | |||
|
|
40 | # * various built-in commands including «command», «set», and «ulimit». | |||
|
|
41 | # | |||
|
|
42 | # Important for patching: | |||
|
|
43 | # | |||
|
|
44 | # (2) This script targets any POSIX shell, so it avoids extensions provided | |||
|
|
45 | # by Bash, Ksh, etc; in particular arrays are avoided. | |||
|
|
46 | # | |||
|
|
47 | # The "traditional" practice of packing multiple parameters into a | |||
|
|
48 | # space-separated string is a well documented source of bugs and security | |||
|
|
49 | # problems, so this is (mostly) avoided, by progressively accumulating | |||
|
|
50 | # options in "$@", and eventually passing that to Java. | |||
|
|
51 | # | |||
|
|
52 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, | |||
|
|
53 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; | |||
|
|
54 | # see the in-line comments for details. | |||
|
|
55 | # | |||
|
|
56 | # There are tweaks for specific operating systems such as AIX, CygWin, | |||
|
|
57 | # Darwin, MinGW, and NonStop. | |||
|
|
58 | # | |||
|
|
59 | # (3) This script is generated from the Groovy template | |||
|
|
60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt | |||
|
|
61 | # within the Gradle project. | |||
|
|
62 | # | |||
|
|
63 | # You can find Gradle at https://github.com/gradle/gradle/. | |||
|
|
64 | # | |||
| 23 | ############################################################################## |
|
65 | ############################################################################## | |
| 24 |
|
66 | |||
| 25 | # Attempt to set APP_HOME |
|
67 | # Attempt to set APP_HOME | |
|
|
68 | ||||
| 26 | # Resolve links: $0 may be a link |
|
69 | # Resolve links: $0 may be a link | |
| 27 | PRG="$0" |
|
70 | app_path=$0 | |
| 28 | # Need this for relative symlinks. |
|
71 | ||
| 29 | while [ -h "$PRG" ] ; do |
|
72 | # Need this for daisy-chained symlinks. | |
| 30 | ls=`ls -ld "$PRG"` |
|
73 | while | |
| 31 | link=`expr "$ls" : '.*-> \(.*\)$'` |
|
74 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path | |
| 32 | if expr "$link" : '/.*' > /dev/null; then |
|
75 | [ -h "$app_path" ] | |
| 33 | PRG="$link" |
|
76 | do | |
| 34 | else |
|
77 | ls=$( ls -ld "$app_path" ) | |
| 35 | PRG=`dirname "$PRG"`"/$link" |
|
78 | link=${ls#*' -> '} | |
| 36 | fi |
|
79 | case $link in #( | |
|
|
80 | /*) app_path=$link ;; #( | |||
|
|
81 | *) app_path=$APP_HOME$link ;; | |||
|
|
82 | esac | |||
| 37 | done |
|
83 | done | |
| 38 | SAVED="`pwd`" |
|
|||
| 39 | cd "`dirname \"$PRG\"`/" >/dev/null |
|
|||
| 40 | APP_HOME="`pwd -P`" |
|
|||
| 41 | cd "$SAVED" >/dev/null |
|
|||
| 42 |
|
84 | |||
| 43 | APP_NAME="Gradle" |
|
85 | # This is normally unused | |
| 44 | APP_BASE_NAME=`basename "$0"` |
|
86 | # shellcheck disable=SC2034 | |
| 45 |
|
87 | APP_BASE_NAME=${0##*/} | ||
| 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. |
|
88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) | |
| 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' |
|
89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit | |
| 48 |
|
90 | |||
| 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. |
|
91 | # Use the maximum available, or set MAX_FD != -1 to use that value. | |
| 50 |
MAX_FD= |
|
92 | MAX_FD=maximum | |
| 51 |
|
93 | |||
| 52 | warn () { |
|
94 | warn () { | |
| 53 | echo "$*" |
|
95 | echo "$*" | |
| 54 | } |
|
96 | } >&2 | |
| 55 |
|
97 | |||
| 56 | die () { |
|
98 | die () { | |
| 57 | echo |
|
99 | echo | |
| 58 | echo "$*" |
|
100 | echo "$*" | |
| 59 | echo |
|
101 | echo | |
| 60 | exit 1 |
|
102 | exit 1 | |
| 61 | } |
|
103 | } >&2 | |
| 62 |
|
104 | |||
| 63 | # OS specific support (must be 'true' or 'false'). |
|
105 | # OS specific support (must be 'true' or 'false'). | |
| 64 | cygwin=false |
|
106 | cygwin=false | |
| 65 | msys=false |
|
107 | msys=false | |
| 66 | darwin=false |
|
108 | darwin=false | |
| 67 | nonstop=false |
|
109 | nonstop=false | |
| 68 | case "`uname`" in |
|
110 | case "$( uname )" in #( | |
| 69 | CYGWIN* ) |
|
111 | CYGWIN* ) cygwin=true ;; #( | |
| 70 | cygwin=true |
|
112 | Darwin* ) darwin=true ;; #( | |
| 71 | ;; |
|
113 | MSYS* | MINGW* ) msys=true ;; #( | |
| 72 | Darwin* ) |
|
114 | NONSTOP* ) nonstop=true ;; | |
| 73 | darwin=true |
|
|||
| 74 | ;; |
|
|||
| 75 | MINGW* ) |
|
|||
| 76 | msys=true |
|
|||
| 77 | ;; |
|
|||
| 78 | NONSTOP* ) |
|
|||
| 79 | nonstop=true |
|
|||
| 80 | ;; |
|
|||
| 81 | esac |
|
115 | esac | |
| 82 |
|
116 | |||
| 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar |
|
117 | ||
| 84 |
|
118 | |||
| 85 | # Determine the Java command to use to start the JVM. |
|
119 | # Determine the Java command to use to start the JVM. | |
| 86 | if [ -n "$JAVA_HOME" ] ; then |
|
120 | if [ -n "$JAVA_HOME" ] ; then | |
| 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then |
|
121 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | |
| 88 | # IBM's JDK on AIX uses strange locations for the executables |
|
122 | # IBM's JDK on AIX uses strange locations for the executables | |
| 89 |
JAVACMD= |
|
123 | JAVACMD=$JAVA_HOME/jre/sh/java | |
| 90 | else |
|
124 | else | |
| 91 |
JAVACMD= |
|
125 | JAVACMD=$JAVA_HOME/bin/java | |
| 92 | fi |
|
126 | fi | |
| 93 | if [ ! -x "$JAVACMD" ] ; then |
|
127 | if [ ! -x "$JAVACMD" ] ; then | |
| 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME |
|
128 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME | |
| @@ -97,92 +131,118 Please set the JAVA_HOME variable in you | |||||
| 97 | location of your Java installation." |
|
131 | location of your Java installation." | |
| 98 | fi |
|
132 | fi | |
| 99 | else |
|
133 | else | |
| 100 |
JAVACMD= |
|
134 | JAVACMD=java | |
| 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. |
|
135 | if ! command -v java >/dev/null 2>&1 | |
|
|
136 | then | |||
|
|
137 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | |||
| 102 |
|
138 | |||
| 103 | Please set the JAVA_HOME variable in your environment to match the |
|
139 | Please set the JAVA_HOME variable in your environment to match the | |
| 104 | location of your Java installation." |
|
140 | location of your Java installation." | |
| 105 | fi |
|
141 | fi | |
| 106 |
|
||||
| 107 | # Increase the maximum file descriptors if we can. |
|
|||
| 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then |
|
|||
| 109 | MAX_FD_LIMIT=`ulimit -H -n` |
|
|||
| 110 | if [ $? -eq 0 ] ; then |
|
|||
| 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then |
|
|||
| 112 | MAX_FD="$MAX_FD_LIMIT" |
|
|||
| 113 | fi |
|
|||
| 114 | ulimit -n $MAX_FD |
|
|||
| 115 | if [ $? -ne 0 ] ; then |
|
|||
| 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" |
|
|||
| 117 | fi |
|
|||
| 118 | else |
|
|||
| 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" |
|
|||
| 120 | fi |
|
|||
| 121 | fi |
|
|||
| 122 |
|
||||
| 123 | # For Darwin, add options to specify how the application appears in the dock |
|
|||
| 124 | if $darwin; then |
|
|||
| 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" |
|
|||
| 126 | fi |
|
142 | fi | |
| 127 |
|
143 | |||
| 128 | # For Cygwin or MSYS, switch paths to Windows format before running java |
|
144 | # Increase the maximum file descriptors if we can. | |
| 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then |
|
145 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then | |
| 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` |
|
146 | case $MAX_FD in #( | |
| 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` |
|
147 | max*) | |
| 132 | JAVACMD=`cygpath --unix "$JAVACMD"` |
|
148 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. | |
| 133 |
|
149 | # shellcheck disable=SC2039,SC3045 | ||
| 134 | # We build the pattern for arguments to be converted via cygpath |
|
150 | MAX_FD=$( ulimit -H -n ) || | |
| 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` |
|
151 | warn "Could not query maximum file descriptor limit" | |
| 136 | SEP="" |
|
152 | esac | |
| 137 | for dir in $ROOTDIRSRAW ; do |
|
153 | case $MAX_FD in #( | |
| 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" |
|
154 | '' | soft) :;; #( | |
| 139 | SEP="|" |
|
155 | *) | |
| 140 | done |
|
156 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. | |
| 141 | OURCYGPATTERN="(^($ROOTDIRS))" |
|
157 | # shellcheck disable=SC2039,SC3045 | |
| 142 | # Add a user-defined pattern to the cygpath arguments |
|
158 | ulimit -n "$MAX_FD" || | |
| 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then |
|
159 | warn "Could not set maximum file descriptor limit to $MAX_FD" | |
| 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" |
|
|||
| 145 | fi |
|
|||
| 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh |
|
|||
| 147 | i=0 |
|
|||
| 148 | for arg in "$@" ; do |
|
|||
| 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` |
|
|||
| 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option |
|
|||
| 151 |
|
||||
| 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition |
|
|||
| 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` |
|
|||
| 154 | else |
|
|||
| 155 | eval `echo args$i`="\"$arg\"" |
|
|||
| 156 | fi |
|
|||
| 157 | i=$((i+1)) |
|
|||
| 158 | done |
|
|||
| 159 | case $i in |
|
|||
| 160 | (0) set -- ;; |
|
|||
| 161 | (1) set -- "$args0" ;; |
|
|||
| 162 | (2) set -- "$args0" "$args1" ;; |
|
|||
| 163 | (3) set -- "$args0" "$args1" "$args2" ;; |
|
|||
| 164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; |
|
|||
| 165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; |
|
|||
| 166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; |
|
|||
| 167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; |
|
|||
| 168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; |
|
|||
| 169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; |
|
|||
| 170 | esac |
|
160 | esac | |
| 171 | fi |
|
161 | fi | |
| 172 |
|
162 | |||
| 173 | # Escape application args |
|
163 | # Collect all arguments for the java command, stacking in reverse order: | |
| 174 | save () { |
|
164 | # * args from the command line | |
| 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done |
|
165 | # * the main class name | |
| 176 | echo " " |
|
166 | # * -classpath | |
| 177 | } |
|
167 | # * -D...appname settings | |
| 178 | APP_ARGS=$(save "$@") |
|
168 | # * --module-path (only if needed) | |
|
|
169 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. | |||
|
|
170 | ||||
|
|
171 | # For Cygwin or MSYS, switch paths to Windows format before running java | |||
|
|
172 | if "$cygwin" || "$msys" ; then | |||
|
|
173 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) | |||
|
|
174 | ||||
|
|
175 | JAVACMD=$( cygpath --unix "$JAVACMD" ) | |||
| 179 |
|
176 | |||
| 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules |
|
177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh | |
| 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" |
|
178 | for arg do | |
| 182 |
|
179 | if | ||
| 183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong |
|
180 | case $arg in #( | |
| 184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then |
|
181 | -*) false ;; # don't mess with options #( | |
| 185 | cd "$(dirname "$0")" |
|
182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath | |
|
|
183 | [ -e "$t" ] ;; #( | |||
|
|
184 | *) false ;; | |||
|
|
185 | esac | |||
|
|
186 | then | |||
|
|
187 | arg=$( cygpath --path --ignore --mixed "$arg" ) | |||
|
|
188 | fi | |||
|
|
189 | # Roll the args list around exactly as many times as the number of | |||
|
|
190 | # args, so each arg winds up back in the position where it started, but | |||
|
|
191 | # possibly modified. | |||
|
|
192 | # | |||
|
|
193 | # NB: a `for` loop captures its iteration list before it begins, so | |||
|
|
194 | # changing the positional parameters here affects neither the number of | |||
|
|
195 | # iterations, nor the values presented in `arg`. | |||
|
|
196 | shift # remove old arg | |||
|
|
197 | set -- "$@" "$arg" # push replacement arg | |||
|
|
198 | done | |||
| 186 | fi |
|
199 | fi | |
| 187 |
|
200 | |||
|
|
201 | ||||
|
|
202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | |||
|
|
203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' | |||
|
|
204 | ||||
|
|
205 | # Collect all arguments for the java command: | |||
|
|
206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, | |||
|
|
207 | # and any embedded shellness will be escaped. | |||
|
|
208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be | |||
|
|
209 | # treated as '${Hostname}' itself on the command line. | |||
|
|
210 | ||||
|
|
211 | set -- \ | |||
|
|
212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ | |||
|
|
213 | -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ | |||
|
|
214 | "$@" | |||
|
|
215 | ||||
|
|
216 | # Stop when "xargs" is not available. | |||
|
|
217 | if ! command -v xargs >/dev/null 2>&1 | |||
|
|
218 | then | |||
|
|
219 | die "xargs is not available" | |||
|
|
220 | fi | |||
|
|
221 | ||||
|
|
222 | # Use "xargs" to parse quoted args. | |||
|
|
223 | # | |||
|
|
224 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. | |||
|
|
225 | # | |||
|
|
226 | # In Bash we could simply go: | |||
|
|
227 | # | |||
|
|
228 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && | |||
|
|
229 | # set -- "${ARGS[@]}" "$@" | |||
|
|
230 | # | |||
|
|
231 | # but POSIX shell has neither arrays nor command substitution, so instead we | |||
|
|
232 | # post-process each arg (as a line of input to sed) to backslash-escape any | |||
|
|
233 | # character that might be a shell metacharacter, then use eval to reverse | |||
|
|
234 | # that process (while maintaining the separation between arguments), and wrap | |||
|
|
235 | # the whole thing up as a single "set" statement. | |||
|
|
236 | # | |||
|
|
237 | # This will of course break if any of these variables contains a newline or | |||
|
|
238 | # an unmatched quote. | |||
|
|
239 | # | |||
|
|
240 | ||||
|
|
241 | eval "set -- $( | |||
|
|
242 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | | |||
|
|
243 | xargs -n1 | | |||
|
|
244 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | | |||
|
|
245 | tr '\n' ' ' | |||
|
|
246 | )" '"$@"' | |||
|
|
247 | ||||
| 188 | exec "$JAVACMD" "$@" |
|
248 | exec "$JAVACMD" "$@" | |
| @@ -13,6 +13,8 | |||||
| 13 | @rem See the License for the specific language governing permissions and |
|
13 | @rem See the License for the specific language governing permissions and | |
| 14 | @rem limitations under the License. |
|
14 | @rem limitations under the License. | |
| 15 | @rem |
|
15 | @rem | |
|
|
16 | @rem SPDX-License-Identifier: Apache-2.0 | |||
|
|
17 | @rem | |||
| 16 |
|
18 | |||
| 17 |
@if "%DEBUG%" |
|
19 | @if "%DEBUG%"=="" @echo off | |
| 18 | @rem ########################################################################## |
|
20 | @rem ########################################################################## | |
| @@ -26,9 +28,13 if "%OS%"=="Windows_NT" setlocal | |||||
| 26 |
|
28 | |||
| 27 | set DIRNAME=%~dp0 |
|
29 | set DIRNAME=%~dp0 | |
| 28 |
if "%DIRNAME%" |
|
30 | if "%DIRNAME%"=="" set DIRNAME=. | |
|
|
31 | @rem This is normally unused | |||
| 29 | set APP_BASE_NAME=%~n0 |
|
32 | set APP_BASE_NAME=%~n0 | |
| 30 | set APP_HOME=%DIRNAME% |
|
33 | set APP_HOME=%DIRNAME% | |
| 31 |
|
34 | |||
|
|
35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. | |||
|
|
36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi | |||
|
|
37 | ||||
| 32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. |
|
38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | |
| 33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" |
|
39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" | |
| 34 |
|
40 | |||
| @@ -37,13 +43,13 if defined JAVA_HOME goto findJavaFromJa | |||||
| 37 |
|
43 | |||
| 38 | set JAVA_EXE=java.exe |
|
44 | set JAVA_EXE=java.exe | |
| 39 | %JAVA_EXE% -version >NUL 2>&1 |
|
45 | %JAVA_EXE% -version >NUL 2>&1 | |
| 40 |
if |
|
46 | if %ERRORLEVEL% equ 0 goto execute | |
| 41 |
|
47 | |||
| 42 | echo. |
|
48 | echo. 1>&2 | |
| 43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. |
|
49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 | |
| 44 | echo. |
|
50 | echo. 1>&2 | |
| 45 | echo Please set the JAVA_HOME variable in your environment to match the |
|
51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 | |
| 46 | echo location of your Java installation. |
|
52 | echo location of your Java installation. 1>&2 | |
| 47 |
|
53 | |||
| 48 | goto fail |
|
54 | goto fail | |
| 49 |
|
55 | |||
| @@ -51,48 +57,35 goto fail | |||||
| 51 | set JAVA_HOME=%JAVA_HOME:"=% |
|
57 | set JAVA_HOME=%JAVA_HOME:"=% | |
| 52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe |
|
58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe | |
| 53 |
|
59 | |||
| 54 |
if exist "%JAVA_EXE%" goto |
|
60 | if exist "%JAVA_EXE%" goto execute | |
| 55 |
|
61 | |||
| 56 | echo. |
|
62 | echo. 1>&2 | |
| 57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% |
|
63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 | |
| 58 | echo. |
|
64 | echo. 1>&2 | |
| 59 | echo Please set the JAVA_HOME variable in your environment to match the |
|
65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 | |
| 60 | echo location of your Java installation. |
|
66 | echo location of your Java installation. 1>&2 | |
| 61 |
|
67 | |||
| 62 | goto fail |
|
68 | goto fail | |
| 63 |
|
69 | |||
| 64 | :init |
|
|||
| 65 | @rem Get command-line arguments, handling Windows variants |
|
|||
| 66 |
|
||||
| 67 | if not "%OS%" == "Windows_NT" goto win9xME_args |
|
|||
| 68 |
|
||||
| 69 | :win9xME_args |
|
|||
| 70 | @rem Slurp the command line arguments. |
|
|||
| 71 | set CMD_LINE_ARGS= |
|
|||
| 72 | set _SKIP=2 |
|
|||
| 73 |
|
||||
| 74 | :win9xME_args_slurp |
|
|||
| 75 | if "x%~1" == "x" goto execute |
|
|||
| 76 |
|
||||
| 77 | set CMD_LINE_ARGS=%* |
|
|||
| 78 |
|
||||
| 79 | :execute |
|
70 | :execute | |
| 80 | @rem Setup the command line |
|
71 | @rem Setup the command line | |
| 81 |
|
72 | |||
| 82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar |
|
73 | ||
| 83 |
|
74 | |||
| 84 | @rem Execute Gradle |
|
75 | @rem Execute Gradle | |
| 85 |
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" - |
|
76 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* | |
| 86 |
|
77 | |||
| 87 | :end |
|
78 | :end | |
| 88 | @rem End local scope for the variables with windows NT shell |
|
79 | @rem End local scope for the variables with windows NT shell | |
| 89 |
if |
|
80 | if %ERRORLEVEL% equ 0 goto mainEnd | |
| 90 |
|
81 | |||
| 91 | :fail |
|
82 | :fail | |
| 92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of |
|
83 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of | |
| 93 | rem the _cmd.exe /c_ return code! |
|
84 | rem the _cmd.exe /c_ return code! | |
| 94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 |
|
85 | set EXIT_CODE=%ERRORLEVEL% | |
| 95 | exit /b 1 |
|
86 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 | |
|
|
87 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% | |||
|
|
88 | exit /b %EXIT_CODE% | |||
| 96 |
|
89 | |||
| 97 | :mainEnd |
|
90 | :mainEnd | |
| 98 | if "%OS%"=="Windows_NT" endlocal |
|
91 | if "%OS%"=="Windows_NT" endlocal | |
| @@ -4,10 +4,9 | |||||
| 4 | "types": [ |
|
4 | "types": [ | |
| 5 | "node" |
|
5 | "node" | |
| 6 | ], |
|
6 | ], | |
| 7 | "rootDir": "ts", |
|
|||
| 8 | "rootDirs": [ |
|
7 | "rootDirs": [ | |
| 9 | "ts", |
|
8 | "ts", | |
| 10 |
"../ |
|
9 | "../main/ts" | |
| 11 | ] |
|
10 | ] | |
| 12 | }, |
|
11 | }, | |
| 13 | "include": [ |
|
12 | "include": [ | |
| @@ -100,8 +100,7 export interface IActivatable { | |||||
| 100 | * @param controller The activation controller |
|
100 | * @param controller The activation controller | |
| 101 | * |
|
101 | * | |
| 102 | * Activation controller checks whether this component |
|
102 | * Activation controller checks whether this component | |
| 103 |
* can be activated and manages the active state of |
|
103 | * can be activated and manages the active state of it. | |
| 104 | * component |
|
|||
| 105 | */ |
|
104 | */ | |
| 106 | setActivationController(controller: IActivationController): void; |
|
105 | setActivationController(controller: IActivationController): void; | |
| 107 |
|
106 | |||
General Comments 0
You need to be logged in to leave comments.
Login now
