Compare commits
116 commits
circleci/c
...
develop
Author | SHA1 | Date | |
---|---|---|---|
|
92909eca41 | ||
|
d2ab1a8399 | ||
|
004edc9419 | ||
|
ee5ed04e2d | ||
|
1a17ee9a4d | ||
|
1eef78c506 | ||
|
d469fca424 | ||
|
1342ce6795 | ||
|
f42ab782fb | ||
|
075239cf4c | ||
|
1e59f588f3 | ||
|
15c7cbe2ae | ||
|
67ddee43c0 | ||
|
f5c8396da0 | ||
|
ec21f6b8d9 | ||
|
c8e939f45b | ||
|
fcbe858fbd | ||
|
a2d1ccc0ce | ||
|
1a64fb2eb3 | ||
|
c31352f2ef | ||
|
7260681ddd | ||
|
7f9cc67604 | ||
|
17a695ad4b | ||
|
9e96d519ab | ||
|
537ea9a652 | ||
|
f83c47a82e | ||
|
9f79dac3c2 | ||
|
8d3324ecb8 | ||
|
f5666d769c | ||
|
754cfad122 | ||
|
a72efce7f5 | ||
|
b74072c553 | ||
|
6a327c2ccb | ||
|
734a33a5b5 | ||
|
58c34f9eba | ||
|
6bf9899b87 | ||
|
0781d4b424 | ||
|
198006568d | ||
|
baa37a506e | ||
|
6a5ceddfc0 | ||
|
4e8aec841e | ||
|
ea3a10b2ab | ||
|
ab53555b56 | ||
|
27f73ff007 | ||
|
56d622f9d9 | ||
|
4d686311ef | ||
|
45e6fbbcca | ||
|
b3ba713de9 | ||
|
fa031afa43 | ||
|
6b32e9dca7 | ||
|
30f6d5bd1b | ||
|
df7393c4b5 | ||
|
8b4bce9f93 | ||
|
1e7b0b56fe | ||
|
d640c77dde | ||
|
d83ec6ab8b | ||
|
f72b406a33 | ||
|
ac1019f247 | ||
|
3820e4c13d | ||
|
eb0f10f79b | ||
|
126cbea108 | ||
|
2ff61c134d | ||
|
c51e6b1a47 | ||
|
d548fb71d7 | ||
|
d2b0546dfb | ||
|
76e8394eda | ||
|
b3c61b2ac7 | ||
|
ca57783ec2 | ||
|
166b19e3a3 | ||
|
dd886a6d8e | ||
|
fec16abdb8 | ||
|
db34e6e535 | ||
|
d3127d801f | ||
|
fc8ceba7f5 | ||
|
456fce719e | ||
|
55f742cf34 | ||
|
dfabe5f7b9 | ||
|
420cb8013e | ||
|
b98577c20a | ||
|
0219641878 | ||
|
813f9a85da | ||
|
a8510843d7 | ||
|
7d09b4d2ca | ||
|
371cf0c09c | ||
|
456f24c086 | ||
|
cac5ecdf88 | ||
|
0c954afddf | ||
|
4dc812e292 | ||
|
4ef8c9dd2c | ||
|
66ca6bc759 | ||
|
97162da0f8 | ||
|
2125a3b57b | ||
|
1b16aae200 | ||
|
a565d6551a | ||
|
2abe9e5cbd | ||
|
e480e2c7eb | ||
|
54044a6f11 | ||
|
0e0208da7e | ||
|
3aaf741129 | ||
|
8728fd190c | ||
|
b5024925a0 | ||
|
b76212d1e8 | ||
|
2484b034ae | ||
|
36f105a220 | ||
|
1afb81590e | ||
|
6d4aa25f26 | ||
|
f57505e1e3 | ||
|
463119b1ac | ||
|
c676f8ac0c | ||
|
2860547770 | ||
|
68b8f18f84 | ||
|
6c9f338e17 | ||
|
9e4790db41 | ||
|
a4390e0cf0 | ||
|
0374f38e84 | ||
|
f2bd5576ba |
27 changed files with 533 additions and 433 deletions
|
@ -1,15 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
|
||||
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
||||
|
||||
<!--
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
|
||||
Palantir Baseline Checkstyle configuration.
|
||||
Authors: Robert Fink, Brian Worth, Merrick Zoubeiri, and many other contributors. Based in part on http://checkstyle.sourceforge.net/google_style.html
|
||||
Please keep checks alphabetized with one exception: "relaxed" checks are grouped together at the bottom for easier disabling.
|
||||
Check-specific comments reference documents internal to Palantir and can be safely ignored or removed.
|
||||
-->
|
||||
|
||||
--><!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
|
||||
<module name="Checker">
|
||||
<property name="charset" value="UTF-8"/>
|
||||
<property name="severity" value="error"/>
|
||||
|
@ -18,15 +12,6 @@
|
|||
<module name="NewlineAtEndOfFile"> <!-- Java Style Guide: Line ending: LF -->
|
||||
<property name="lineSeparator" value="lf"/>
|
||||
</module>
|
||||
<module name="RegexpHeader">
|
||||
<property name="header" value="^/\*$\n^ \* \(c\) Copyright \d{4} Palantir Technologies Inc\. All rights reserved\.$"/>
|
||||
<property name="fileExtensions" value=".java,.ts"/>
|
||||
</module>
|
||||
<module name="RegexpMultiline"> <!-- Development Practices: Writing good unit tests -->
|
||||
<property name="fileExtensions" value="java"/>
|
||||
<property name="format" value="@VisibleForTesting\s+(protected|public)"/>
|
||||
<property name="message" value="@VisibleForTesting members should be package-private."/>
|
||||
</module>
|
||||
<module name="RegexpSingleline"> <!-- No reference needed as this is evident. -->
|
||||
<property name="format" value="<<<<<<<"/>
|
||||
<property name="message" value="Found (<<<<<<<), so it looks like you had a merge conflict that compiles. Please fix it."/>
|
||||
|
@ -56,6 +41,10 @@
|
|||
<module name="BeforeExecutionExclusionFileFilter">
|
||||
<property name="fileNamePattern" value="module\-info\.java$"/>
|
||||
</module>
|
||||
<module name="LineLength"> <!-- Java Style Guide: No line-wrapping -->
|
||||
<property name="max" value="120"/>
|
||||
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://|\{@link"/>
|
||||
</module>
|
||||
<module name="TreeWalker">
|
||||
<module name="SuppressionCommentFilter"/> <!-- baseline-gradle: README.md -->
|
||||
<module name="SuppressionCommentFilter">
|
||||
|
@ -74,7 +63,9 @@
|
|||
<property name="tokens" value="VARIABLE_DEF"/>
|
||||
<property name="allowSamelineMultipleAnnotations" value="true"/>
|
||||
</module>
|
||||
<module name="AnnotationUseStyle"/> <!-- Java Style Guide: Annotations -->
|
||||
<module name="AnnotationUseStyle"> <!-- Java Style Guide: Annotations -->
|
||||
<property name="trailingArrayComma" value="ignore"/>
|
||||
</module>
|
||||
<module name="ArrayTypeStyle"/> <!-- Java Style Guide: No C-style array declarations -->
|
||||
<module name="AvoidEscapedUnicodeCharacters"> <!-- Java Style Guide: Non-ASCII characters -->
|
||||
<property name="allowEscapesForControlCharacters" value="true"/>
|
||||
|
@ -86,14 +77,7 @@
|
|||
</module>
|
||||
<module name="AvoidStarImport"/> <!-- Java Style Guide: No wildcard imports -->
|
||||
<module name="AvoidStaticImport"> <!-- Java Style Guide: No static imports -->
|
||||
<property name="excludes" value="
|
||||
com.google.common.base.Preconditions.*,
|
||||
com.palantir.logsafe.Preconditions.*,
|
||||
java.util.Collections.*,
|
||||
java.util.stream.Collectors.*,
|
||||
org.apache.commons.lang3.Validate.*,
|
||||
org.assertj.core.api.Assertions.*,
|
||||
org.mockito.Mockito.*"/>
|
||||
<property name="excludes" value="com.google.common.base.Preconditions.*, com.palantir.logsafe.Preconditions.*, java.util.Collections.*, java.util.stream.Collectors.*, org.apache.commons.lang3.Validate.*, org.assertj.core.api.Assertions.*, org.mockito.Mockito.*"/>
|
||||
</module>
|
||||
<module name="ClassTypeParameterName"> <!-- Java Style Guide: Type variable names -->
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||
|
@ -143,12 +127,12 @@
|
|||
<module name="IllegalImport"> <!-- Java Coding Guidelines: Import the canonical package -->
|
||||
<property name="id" value="BanShadedClasses"/>
|
||||
<property name="illegalPkgs" value=".*\.(repackaged|shaded|thirdparty)"/>
|
||||
<property name="regexp" value="true" />
|
||||
<property name="regexp" value="true"/>
|
||||
<message key="import.illegal" value="Must not import repackaged classes."/>
|
||||
</module>
|
||||
<module name="IllegalImport">
|
||||
<property name="illegalPkgs" value="^org\.gradle\.(internal|.*\.internal)"/>
|
||||
<property name="regexp" value="true" />
|
||||
<property name="regexp" value="true"/>
|
||||
<message key="import.illegal" value="Do not rely on gradle internal classes as these may change in minor releases - use org.gradle.api versions instead."/>
|
||||
</module>
|
||||
<module name="IllegalImport">
|
||||
|
@ -201,12 +185,9 @@
|
|||
<property name="separated" value="true"/>
|
||||
<property name="sortStaticImportsAlphabetically" value="true"/>
|
||||
</module>
|
||||
|
||||
<module name="InnerAssignment"/> <!-- Java Coding Guidelines: Inner assignments: Not used -->
|
||||
<module name="LeftCurly"/> <!-- Java Style Guide: Nonempty blocks: K & R style -->
|
||||
<module name="LineLength"> <!-- Java Style Guide: No line-wrapping -->
|
||||
<property name="max" value="120"/>
|
||||
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
|
||||
</module>
|
||||
<!-- Java Style Guide: Nonempty blocks: K & R style -->
|
||||
<module name="MemberName"> <!-- Java Style Guide: Non-constant field names -->
|
||||
<property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
|
||||
<message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
|
||||
|
@ -247,7 +228,7 @@
|
|||
<message key="name.invalidPattern" value="Package name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="ParameterAssignment"/> <!-- Java Coding Guidelines: Final variables and parameters -->
|
||||
<module name="ParenPad"/> <!-- Java Style Guide: Horizontal whitespace -->
|
||||
<!-- Java Style Guide: Horizontal whitespace -->
|
||||
<module name="RedundantImport"/> <!-- Java Style Guide: No unused imports -->
|
||||
<module name="RedundantModifier"/> <!-- Java Coding Guidelines: Avoid redundant modifiers -->
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Use appropriate assertion methods -->
|
||||
|
@ -363,7 +344,7 @@
|
|||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="\bCharset.defaultCharset\("/>
|
||||
<property name="message" value="Use explicit charset (e.g. StandardCharsets.UTF-8) instead of default."/>
|
||||
<property name="message" value="Use explicit charset (e.g. StandardCharsets.UTF_8) instead of default."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="\bIOUtils\.toString\("/>
|
||||
|
@ -372,6 +353,7 @@
|
|||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="\/\/TODO|\/\/ TODO(?!\([^()\s]+\): )"/>
|
||||
<property name="message" value="TODO format: // TODO(#issue): explanation"/>
|
||||
<property name="ignoreCase" value="true"/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="(void setUp\(\))|(void setup\(\))|(void setupStatic\(\))|(void setUpStatic\(\))|(void beforeTest\(\))|(void teardown\(\))|(void tearDown\(\))|(void beforeStatic\(\))|(void afterStatic\(\))"/>
|
||||
|
@ -379,11 +361,11 @@
|
|||
</module>
|
||||
<module name="RightCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style -->
|
||||
<property name="option" value="same"/>
|
||||
<property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
|
||||
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
|
||||
</module>
|
||||
<module name="RightCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style -->
|
||||
<property name="option" value="alone"/>
|
||||
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
|
||||
<property name="tokens" value="LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap"> <!-- Java Style Guide: Where to break -->
|
||||
<property name="tokens" value="DOT"/>
|
||||
|
@ -401,28 +383,18 @@
|
|||
<module name="SuppressWarnings">
|
||||
<property name="format" value="serial"/>
|
||||
</module>
|
||||
<module name="SuppressWarningsHolder" /> <!-- Required for SuppressWarningsFilter -->
|
||||
<module name="SuppressWarningsHolder"/> <!-- Required for SuppressWarningsFilter -->
|
||||
<module name="TypeName"> <!-- Java Style Guide: Class names -->
|
||||
<message key="name.invalidPattern" value="Type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="TypecastParenPad"/> <!-- Java Style Guide: Horizontal whitespace -->
|
||||
<module name="UnnecessaryParentheses"/>
|
||||
<module name="UnusedImports"> <!-- Java Style Guide: No unused imports -->
|
||||
<property name="processJavadoc" value="true"/>
|
||||
</module>
|
||||
<module name="UpperEll"/> <!-- Java Style Guide: Numeric Literals -->
|
||||
<module name="VisibilityModifier"/> <!-- Java Coding Guidelines: Minimize mutability -->
|
||||
<module name="WhitespaceAfter"/> <!-- Java Style Guide: Horizontal whitespace -->
|
||||
<module name="WhitespaceAround"> <!-- Java Style Guide: Horizontal whitespace -->
|
||||
<property name="allowEmptyConstructors" value="true"/>
|
||||
<property name="allowEmptyMethods" value="true"/>
|
||||
<property name="allowEmptyTypes" value="true"/>
|
||||
<property name="allowEmptyLoops" value="true"/>
|
||||
<property name="allowEmptyLambdas" value="true"/>
|
||||
<property name="ignoreEnhancedForColon" value="false"/>
|
||||
<message key="ws.notFollowed" value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
|
||||
<message key="ws.notPreceded" value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
|
||||
</module>
|
||||
|
||||
|
||||
<!-- Stricter checks begin: delete some or all of the following for faster prototyping, but please restore before pushing to production. -->
|
||||
|
||||
|
@ -430,18 +402,17 @@
|
|||
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
|
||||
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
|
||||
</module>
|
||||
<module name="CyclomaticComplexity"/> <!-- Java Coding Guidelines: Reduce Cyclomatic Complexity -->
|
||||
<module name="CyclomaticComplexity"> <!-- Java Coding Guidelines: Reduce Cyclomatic Complexity -->
|
||||
<property name="switchBlockAsSingleDecisionPoint" value="true"/>
|
||||
</module>
|
||||
<module name="DesignForExtension"> <!-- Java Coding Guidelines: Design for extension -->
|
||||
<property name="ignoredAnnotations" value="ParameterizedTest, Test, Before, BeforeEach, After, AfterEach, BeforeClass, BeforeAll, AfterClass, AfterAll"/>
|
||||
</module>
|
||||
<module name="JavadocMethod"> <!-- Java Style Guide: Where Javadoc is used -->
|
||||
<property name="scope" value="public"/>
|
||||
<property name="accessModifiers" value="public"/>
|
||||
<property name="allowMissingParamTags" value="true"/>
|
||||
<property name="allowMissingThrowsTags" value="true"/>
|
||||
<property name="allowMissingReturnTag" value="true"/>
|
||||
<property name="minLineCount" value="99999999"/>
|
||||
<property name="allowedAnnotations" value="Override, Test"/>
|
||||
<property name="allowThrowsTagsForSubclasses" value="true"/>
|
||||
</module>
|
||||
<module name="JavadocStyle"/> <!-- Java Style Guide: Javadoc -->
|
||||
<module name="JavadocTagContinuationIndentation"> <!-- Java Style Guide: At-clauses -->
|
||||
|
@ -474,4 +445,4 @@
|
|||
|
||||
<!-- Stricter checks end -->
|
||||
</module>
|
||||
</module>
|
||||
</module>
|
|
@ -8,9 +8,9 @@ org.eclipse.jdt.ui.ignorelowercasenames=true
|
|||
org.eclipse.jdt.ui.importorder=;
|
||||
org.eclipse.jdt.ui.javadoc=false
|
||||
org.eclipse.jdt.ui.keywordthis=false
|
||||
org.eclipse.jdt.ui.ondemandthreshold=99
|
||||
org.eclipse.jdt.ui.ondemandthreshold=999
|
||||
org.eclipse.jdt.ui.overrideannotation=true
|
||||
org.eclipse.jdt.ui.staticondemandthreshold=99
|
||||
org.eclipse.jdt.ui.staticondemandthreshold=999
|
||||
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment"/><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*\n * (c) Copyright ${year} Palantir Technologies Inc. All rights reserved.\n */\n\n${package_declaration}\n\n/**\n * \n */\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">throw new RuntimeException(${exception_var});</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
|
||||
sp_cleanup.add_default_serial_version_id=true
|
||||
sp_cleanup.add_generated_serial_version_id=false
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<option name="BINARY_OPERATION_WRAP" value="1" />
|
||||
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
|
||||
<option name="CALL_PARAMETERS_WRAP" value="1" />
|
||||
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
|
||||
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
|
||||
<option name="DOWHILE_BRACE_FORCE" value="3" />
|
||||
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
|
||||
<option name="EXTENDS_LIST_WRAP" value="1" />
|
||||
|
@ -30,9 +30,10 @@
|
|||
<package name="" static="false" withSubpackages="true" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="INSERT_INNER_CLASS_IMPORTS" value="true" />
|
||||
<GroovyCodeStyleSettings>
|
||||
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
|
||||
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
|
||||
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
|
||||
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
|
||||
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
|
||||
<value />
|
||||
</option>
|
||||
|
@ -43,6 +44,21 @@
|
|||
<package name="" withSubpackages="true" static="false" />
|
||||
</value>
|
||||
</option>
|
||||
<!-- Should be a superset of https://github.com/google/error-prone/blob/c481b3f9c2da112db36ccfcbf64e755261a127ab/core/src/main/java/com/google/errorprone/bugpatterns/BadImport.java#L63 -->
|
||||
<DO_NOT_IMPORT_INNER>
|
||||
<CLASS name="Builder" />
|
||||
<CLASS name="BuilderFactory" />
|
||||
<CLASS name="Callback" />
|
||||
<CLASS name="Class" />
|
||||
<CLASS name="Entry" />
|
||||
<CLASS name="Enum" />
|
||||
<CLASS name="Factory" />
|
||||
<CLASS name="Type" />
|
||||
<CLASS name="Key" />
|
||||
<CLASS name="Id" />
|
||||
<CLASS name="Identifier" />
|
||||
<CLASS name="Provider" />
|
||||
</DO_NOT_IMPORT_INNER>
|
||||
</GroovyCodeStyleSettings>
|
||||
<option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" />
|
||||
<option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
|
||||
|
@ -55,7 +71,7 @@
|
|||
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
|
||||
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
|
||||
<option name="METHOD_PARAMETERS_WRAP" value="1" />
|
||||
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
|
||||
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
|
||||
<option name="OPTIMIZE_IMPORTS_ON_THE_FLY" value="true" />
|
||||
<option name="OTHER_INDENT_OPTIONS">
|
||||
<value>
|
||||
|
|
|
@ -1,113 +1,148 @@
|
|||
version: 2
|
||||
jobs:
|
||||
compile:
|
||||
docker: [{ image: 'circleci/openjdk:8-node' }]
|
||||
resource_class: medium+
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
|
||||
- restore_cache: { key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
|
||||
- run: ./gradlew --profile --parallel --stacktrace resolveConfigurations
|
||||
- save_cache:
|
||||
key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}'
|
||||
paths: [ ~/.gradle/wrapper ]
|
||||
- save_cache:
|
||||
key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
|
||||
paths: [ ~/.gradle/caches ]
|
||||
- run: ./gradlew --profile --parallel --stacktrace classes testClasses
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
paths: [ . ]
|
||||
# This file was generated by the excavator check 'excavator/manage-circleci' as specified in .circleci/template.sh.
|
||||
# To request a modification to the general template, file an issue on Excavator.
|
||||
# To manually manage the CircleCI configuration for this project, remove the .circleci/template.sh file.
|
||||
|
||||
compile-jdk11:
|
||||
docker: [{ image: 'circleci/openjdk:11-node' }]
|
||||
resource_class: medium+
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache: { key: 'gradle-wrapper-v2-jdk11-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
|
||||
- restore_cache: { key: 'gradle-cache-v2-jdk11-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
|
||||
- run: ./gradlew --profile --parallel --stacktrace resolveConfigurations
|
||||
- save_cache:
|
||||
key: 'gradle-wrapper-v2-jdk11-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}'
|
||||
paths: [ ~/.gradle/wrapper ]
|
||||
- save_cache:
|
||||
key: 'gradle-cache-v2-jdk11-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
|
||||
paths: [ ~/.gradle/caches ]
|
||||
- run: ./gradlew --profile --parallel --stacktrace classes testClasses
|
||||
version: 2.1
|
||||
jobs:
|
||||
|
||||
check:
|
||||
docker: [{ image: 'circleci/openjdk:8-node' }]
|
||||
resource_class: medium+
|
||||
steps:
|
||||
- attach_workspace: { at: . }
|
||||
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
|
||||
- restore_cache: { key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
|
||||
- restore_cache: { key: 'graal-cache' }
|
||||
- run: (sudo apt-get update || sudo apt-get update) && sudo apt-get install build-essential zlib1g-dev
|
||||
- run: ./gradlew --profile --parallel --stacktrace --continue check
|
||||
- save_cache:
|
||||
key: 'graal-cache'
|
||||
paths: [ ~/.gradle/caches/com.palantir.graal ]
|
||||
- store_test_results: { path: build/test-results }
|
||||
- store_artifacts: { path: build/reports/tests }
|
||||
|
||||
check-jdk11:
|
||||
docker: [{ image: 'circleci/openjdk:11-node' }]
|
||||
resource_class: medium+
|
||||
docker: [{ image: 'cimg/openjdk:11.0.10-node' }]
|
||||
resource_class: large
|
||||
environment:
|
||||
CIRCLE_TEST_REPORTS: /home/circleci/junit
|
||||
CIRCLE_ARTIFACTS: /home/circleci/artifacts
|
||||
GRADLE_OPTS: -Dorg.gradle.workers.max=2 -Dorg.gradle.jvmargs='-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
|
||||
_JAVA_OPTIONS: -XX:ActiveProcessorCount=4 -XX:MaxRAM=8g -XX:+CrashOnOutOfMemoryError -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache: { key: 'gradle-wrapper-v2-jdk11-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
|
||||
- restore_cache: { key: 'gradle-cache-v2-jdk11-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
|
||||
- restore_cache: { key: 'graal-cache' }
|
||||
- run: (sudo apt-get update || sudo apt-get update) && sudo apt-get install build-essential zlib1g-dev
|
||||
- run: ./gradlew --profile --parallel --stacktrace --continue check
|
||||
- run:
|
||||
name: delete_unrelated_tags
|
||||
command: |
|
||||
ALL_TAGS=$(git tag --points-at HEAD)
|
||||
|
||||
if [ -z "$ALL_TAGS" ]; then
|
||||
echo "No-op as there are no tags on the current commit ($(git rev-parse HEAD))"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "${CIRCLE_TAG:+x}" ]; then
|
||||
echo "Non-tag build, deleting all tags which point to HEAD: [${ALL_TAGS/$'\n'/,}]"
|
||||
echo "$ALL_TAGS" | while read -r TAG; do git tag -d "$TAG" 1>/dev/null; done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TAGS_TO_DELETE=$(echo "$ALL_TAGS" | grep -v "^$CIRCLE_TAG$" || :)
|
||||
if [ -z "$TAGS_TO_DELETE" ]; then
|
||||
echo "No-op as exactly one tag ($CIRCLE_TAG) points to HEAD"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Detected tag build, deleting all tags except '$CIRCLE_TAG' which point to HEAD: [${TAGS_TO_DELETE/$'\n'/,}]"
|
||||
echo "$TAGS_TO_DELETE" | while read -r TAG; do git tag -d "$TAG" 1>/dev/null; done
|
||||
- restore_cache: { key: 'gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
|
||||
- restore_cache: { key: 'check-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
|
||||
- run:
|
||||
name: check-setup
|
||||
command: |
|
||||
if [ -x .circleci/check-setup.sh ]; then
|
||||
echo "Running check-setup" && .circleci/check-setup.sh && echo "check-setup complete"
|
||||
fi
|
||||
- run: ./gradlew --parallel --stacktrace --continue --max-workers=2 check -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
|
||||
- persist_to_workspace:
|
||||
root: /home/circleci
|
||||
paths: [ project ]
|
||||
- save_cache:
|
||||
key: 'graal-cache'
|
||||
paths: [ ~/.gradle/caches/com.palantir.graal ]
|
||||
- store_test_results: { path: build/test-results }
|
||||
- store_artifacts: { path: build/reports/tests }
|
||||
key: 'gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}'
|
||||
paths: [ ~/.gradle/wrapper ]
|
||||
- save_cache:
|
||||
key: 'check-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
|
||||
paths: [ ~/.gradle/caches ]
|
||||
- run:
|
||||
command: mkdir -p ~/junit && find . -type f -regex ".*/build/.*TEST.*xml" -exec cp --parents {} ~/junit/ \;
|
||||
when: always
|
||||
- store_test_results: { path: ~/junit }
|
||||
- store_artifacts: { path: ~/artifacts }
|
||||
|
||||
trial-publish:
|
||||
docker: [{ image: 'circleci/openjdk:8-node' }]
|
||||
docker: [{ image: 'cimg/openjdk:11.0.10-node' }]
|
||||
resource_class: medium
|
||||
environment:
|
||||
CIRCLE_TEST_REPORTS: /home/circleci/junit
|
||||
CIRCLE_ARTIFACTS: /home/circleci/artifacts
|
||||
GRADLE_OPTS: -Dorg.gradle.workers.max=1 -Dorg.gradle.jvmargs='-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
|
||||
_JAVA_OPTIONS: -XX:ActiveProcessorCount=2 -XX:MaxRAM=4g -XX:+CrashOnOutOfMemoryError -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
|
||||
steps:
|
||||
- attach_workspace: { at: . }
|
||||
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
|
||||
- restore_cache: { key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
|
||||
- run: ./gradlew --profile --stacktrace publishToMavenLocal
|
||||
- checkout
|
||||
- run:
|
||||
name: delete_unrelated_tags
|
||||
command: |
|
||||
ALL_TAGS=$(git tag --points-at HEAD)
|
||||
|
||||
if [ -z "$ALL_TAGS" ]; then
|
||||
echo "No-op as there are no tags on the current commit ($(git rev-parse HEAD))"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "${CIRCLE_TAG:+x}" ]; then
|
||||
echo "Non-tag build, deleting all tags which point to HEAD: [${ALL_TAGS/$'\n'/,}]"
|
||||
echo "$ALL_TAGS" | while read -r TAG; do git tag -d "$TAG" 1>/dev/null; done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TAGS_TO_DELETE=$(echo "$ALL_TAGS" | grep -v "^$CIRCLE_TAG$" || :)
|
||||
if [ -z "$TAGS_TO_DELETE" ]; then
|
||||
echo "No-op as exactly one tag ($CIRCLE_TAG) points to HEAD"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Detected tag build, deleting all tags except '$CIRCLE_TAG' which point to HEAD: [${TAGS_TO_DELETE/$'\n'/,}]"
|
||||
echo "$TAGS_TO_DELETE" | while read -r TAG; do git tag -d "$TAG" 1>/dev/null; done
|
||||
- restore_cache: { key: 'gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
|
||||
- restore_cache: { key: 'trial-publish-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
|
||||
- run: ./gradlew --stacktrace publishToMavenLocal -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
|
||||
- run:
|
||||
command: git status --porcelain
|
||||
when: always
|
||||
- save_cache:
|
||||
key: 'trial-publish-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
|
||||
paths: [ ~/.gradle/caches ]
|
||||
- store_test_results: { path: ~/junit }
|
||||
- store_artifacts: { path: ~/artifacts }
|
||||
|
||||
publish:
|
||||
docker: [{ image: 'circleci/openjdk:8-node' }]
|
||||
docker: [{ image: 'cimg/openjdk:11.0.10-node' }]
|
||||
resource_class: medium
|
||||
environment:
|
||||
CIRCLE_TEST_REPORTS: /home/circleci/junit
|
||||
CIRCLE_ARTIFACTS: /home/circleci/artifacts
|
||||
GRADLE_OPTS: -Dorg.gradle.workers.max=1 -Dorg.gradle.jvmargs='-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
|
||||
_JAVA_OPTIONS: -XX:ActiveProcessorCount=2 -XX:MaxRAM=4g -XX:+CrashOnOutOfMemoryError -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
|
||||
steps:
|
||||
- attach_workspace: { at: . }
|
||||
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
|
||||
- restore_cache: { key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
|
||||
- attach_workspace: { at: /home/circleci }
|
||||
- restore_cache: { key: 'gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
|
||||
- restore_cache: { key: 'publish-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
|
||||
- deploy:
|
||||
command: ./gradlew --profile --parallel --stacktrace --continue publish
|
||||
- deploy:
|
||||
command: ./gradlew --profile --parallel --stacktrace -Pgradle.publish.key=$GRADLE_KEY -Pgradle.publish.secret=$GRADLE_SECRET publishPlugins
|
||||
command: ./gradlew --parallel --stacktrace --continue publish -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
|
||||
- run:
|
||||
command: git status --porcelain
|
||||
when: always
|
||||
- save_cache:
|
||||
key: 'publish-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
|
||||
paths: [ ~/.gradle/caches ]
|
||||
- store_test_results: { path: ~/junit }
|
||||
- store_artifacts: { path: ~/artifacts }
|
||||
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build:
|
||||
jobs:
|
||||
- compile:
|
||||
filters: { tags: { only: /.*/ } }
|
||||
|
||||
- check:
|
||||
requires: [ compile ]
|
||||
filters: { tags: { only: /.*/ } }
|
||||
|
||||
- compile-jdk11:
|
||||
filters: { tags: { only: /.*/ } }
|
||||
|
||||
- check-jdk11:
|
||||
requires: [ compile-jdk11 ]
|
||||
filters: { tags: { only: /.*/ } }
|
||||
|
||||
- trial-publish:
|
||||
requires: [ compile ]
|
||||
filters: { branches: { ignore: develop } }
|
||||
|
||||
- publish:
|
||||
requires: [ check, check-jdk11 ]
|
||||
requires: [ check, trial-publish ]
|
||||
filters: { tags: { only: /.*/ }, branches: { only: develop } }
|
||||
|
||||
|
|
3
.circleci/template.sh
Normal file
3
.circleci/template.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
export CIRCLECI_TEMPLATE=java-library-oss
|
||||
export JDK=11
|
|
@ -7,3 +7,4 @@ auto-label:
|
|||
tags:
|
||||
roomba: [ "merge when ready" ]
|
||||
automerge: [ "merge when ready" ]
|
||||
autorelease: [ "autorelease" ]
|
||||
|
|
31
.policy.yml
31
.policy.yml
|
@ -3,12 +3,11 @@
|
|||
policy:
|
||||
approval:
|
||||
- or:
|
||||
- infrastructure-notify has been notified
|
||||
- one admin has approved (PR contributors not allowed)
|
||||
- two admins have approved
|
||||
- changelog only and contributor approval
|
||||
- fixing excavator
|
||||
- excavator only touched baseline, circle, gradle files, godel files, docker-compose-rule config or versions.props
|
||||
- excavator only touched baseline, circle, gradle files, godel files, generated code, go dependencies, docker-compose-rule config or versions.props
|
||||
- excavator only touched config files
|
||||
- bots updated package.json and lock files
|
||||
disapproval:
|
||||
|
@ -16,15 +15,6 @@ policy:
|
|||
organizations: [ "palantir" ]
|
||||
|
||||
approval_rules:
|
||||
- name: infrastructure-notify has been notified
|
||||
options:
|
||||
allow_contributor: false
|
||||
request_review:
|
||||
enabled: true
|
||||
requires:
|
||||
count: 1
|
||||
teams: [ "palantir/infrastructure-notify" ]
|
||||
|
||||
- name: one admin has approved (PR contributors not allowed)
|
||||
options:
|
||||
allow_contributor: false
|
||||
|
@ -60,7 +50,7 @@ approval_rules:
|
|||
has_author_in:
|
||||
users: [ "svc-excavator-bot" ]
|
||||
|
||||
- name: excavator only touched baseline, circle, gradle files, godel files, docker-compose-rule config or versions.props
|
||||
- name: excavator only touched baseline, circle, gradle files, godel files, generated code, go dependencies, docker-compose-rule config or versions.props
|
||||
requires:
|
||||
count: 0
|
||||
if:
|
||||
|
@ -75,15 +65,24 @@ approval_rules:
|
|||
- "^\\.circleci/.*$"
|
||||
- "^\\.docker-compose-rule\\.yml$"
|
||||
- "^.*gradle$"
|
||||
- "^\\.palantir/go-version$"
|
||||
- "^gradle/wrapper/.*"
|
||||
- "^gradlew$"
|
||||
- "^gradlew.bat$"
|
||||
- "^gradle.properties$"
|
||||
- "^settings.gradle$"
|
||||
- "^godelw$"
|
||||
- "^godel/config/godel.properties$"
|
||||
- "^.*go.mod$"
|
||||
- "^.*go.sum$"
|
||||
- "^.*godelw$"
|
||||
- "^.*godel/config/godel.properties$"
|
||||
- "^.*godel/config/godel.yml$"
|
||||
- "^.*vendor/.*$"
|
||||
- "^versions.props$"
|
||||
- "^versions.lock$"
|
||||
- "^internal/generated/.*"
|
||||
- "^internal/generated_src/.*"
|
||||
has_valid_signatures_by_keys:
|
||||
key_ids: ["C9AF124A484882E0"]
|
||||
|
||||
- name: excavator only touched config files
|
||||
requires:
|
||||
|
@ -95,6 +94,8 @@ approval_rules:
|
|||
paths:
|
||||
- "^\\..*.yml$"
|
||||
- "^\\.github/.*$"
|
||||
has_valid_signatures_by_keys:
|
||||
key_ids: ["C9AF124A484882E0"]
|
||||
|
||||
- name: bots updated package.json and lock files
|
||||
requires:
|
||||
|
@ -108,3 +109,5 @@ approval_rules:
|
|||
paths:
|
||||
- "^.*yarn.lock$"
|
||||
- "^.*package.json$"
|
||||
has_valid_signatures_by_keys:
|
||||
key_ids: ["C9AF124A484882E0"]
|
||||
|
|
|
@ -36,7 +36,7 @@ Configure this plugin and its wrappers around GraalVM tools through the `graal`
|
|||
**`native-image` controls**
|
||||
* `outputName`: the name to use for the image output
|
||||
* `mainClass`: the main class entry-point for the image to run
|
||||
* `option`: additional native-image options `https://github.com/oracle/graal/blob/master/substratevm/Options.md`
|
||||
* `option`: additional native-image options (see https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/Options.md)
|
||||
|
||||
Local GraalVM Tooling Cache
|
||||
---------------------------
|
||||
|
|
96
build.gradle
96
build.gradle
|
@ -13,67 +13,66 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import net.ltgt.gradle.errorprone.CheckSeverity
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
gradlePluginPortal()
|
||||
maven { url 'https://palantir.bintray.com/releases'}
|
||||
mavenCentral() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } }
|
||||
gradlePluginPortal() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.palantir.javaformat:gradle-palantir-java-format:1.0.1'
|
||||
classpath 'com.netflix.nebula:gradle-info-plugin:9.1.1'
|
||||
classpath 'com.gradle.publish:plugin-publish-plugin:0.12.0'
|
||||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
|
||||
classpath 'com.netflix.nebula:nebula-publishing-plugin:17.3.2'
|
||||
classpath 'com.palantir.baseline:gradle-baseline-java:2.49.1'
|
||||
classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.27.0'
|
||||
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.3'
|
||||
classpath 'gradle.plugin.org.inferred:gradle-processors:3.3.0'
|
||||
classpath 'com.palantir.jakartapackagealignment:jakarta-package-alignment:0.5.0'
|
||||
classpath 'com.palantir.gradle.jdks:gradle-jdks:0.31.0'
|
||||
classpath 'com.palantir.gradle.jdkslatest:gradle-jdks-latest:0.7.0'
|
||||
classpath 'com.gradle.publish:plugin-publish-plugin:1.1.0'
|
||||
classpath 'com.palantir.baseline:gradle-baseline-java:4.188.0'
|
||||
classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:2.12.0'
|
||||
classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.11.0'
|
||||
classpath 'com.palantir.gradle.gitversion:gradle-git-version:1.0.0'
|
||||
classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.28.0'
|
||||
classpath 'gradle.plugin.org.inferred:gradle-processors:3.7.0'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
gradlePluginPortal()
|
||||
maven { url 'https://palantir.bintray.com/releases'}
|
||||
allprojects {
|
||||
apply plugin: 'com.palantir.jakarta-package-alignment'
|
||||
}
|
||||
|
||||
apply plugin: 'com.gradle.plugin-publish'
|
||||
apply plugin: 'com.palantir.baseline'
|
||||
apply plugin: 'com.palantir.git-version'
|
||||
apply plugin: 'com.palantir.consistent-versions'
|
||||
apply plugin: 'nebula.maven-publish'
|
||||
apply plugin: 'nebula.source-jar'
|
||||
apply plugin: 'org.inferred.processors'
|
||||
apply plugin: 'java-gradle-plugin'
|
||||
apply plugin: 'groovy'
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'idea'
|
||||
|
||||
apply plugin: 'com.palantir.baseline'
|
||||
apply plugin: 'com.palantir.baseline-java-versions'
|
||||
apply plugin: 'com.palantir.consistent-versions'
|
||||
apply plugin: 'com.palantir.external-publish-gradle-plugin'
|
||||
apply plugin: 'com.palantir.external-publish-jar'
|
||||
apply plugin: 'com.palantir.git-version'
|
||||
apply plugin: 'com.palantir.java-format'
|
||||
apply from: "${rootDir}/gradle/bintray-publish.gradle"
|
||||
apply plugin: 'com.palantir.jdks.latest'
|
||||
apply plugin: 'org.inferred.processors'
|
||||
|
||||
group 'com.palantir.graal'
|
||||
version gitVersion()
|
||||
|
||||
dependencies {
|
||||
compile localGroovy()
|
||||
compile gradleApi()
|
||||
repositories {
|
||||
mavenCentral() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } }
|
||||
}
|
||||
|
||||
testCompile gradleTestKit()
|
||||
testCompile 'com.netflix.nebula:nebula-test'
|
||||
testCompile 'com.squareup.okhttp3:mockwebserver'
|
||||
dependencies {
|
||||
implementation localGroovy()
|
||||
implementation gradleApi()
|
||||
|
||||
testImplementation gradleTestKit()
|
||||
testImplementation 'com.netflix.nebula:nebula-test'
|
||||
testImplementation 'com.squareup.okhttp3:mockwebserver'
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
// do not add new task to publish to plugins.gradle.org
|
||||
automatedPublishing = false
|
||||
|
||||
plugins {
|
||||
graal {
|
||||
id = 'com.palantir.graal'
|
||||
displayName = 'Palantir Graal Plugin'
|
||||
implementationClass = 'com.palantir.gradle.graal.GradleGraalPlugin'
|
||||
}
|
||||
}
|
||||
|
@ -84,22 +83,19 @@ pluginBundle {
|
|||
vcsUrl = 'https://github.com/palantir/gradle-graal'
|
||||
description = 'A plugin for Gradle that adds tasks to download, extract and interact with GraalVM tooling.'
|
||||
tags = ['graal', 'native-image']
|
||||
}
|
||||
|
||||
plugins {
|
||||
graal {
|
||||
id = 'com.palantir.graal'
|
||||
displayName = 'Palantir Graal Plugin'
|
||||
}
|
||||
tasks.withType(JavaCompile) {
|
||||
options.compilerArgs += ['-Werror']
|
||||
options.errorprone {
|
||||
check("PreferSafeLogger", CheckSeverity.OFF)
|
||||
check("PreferSafeLoggingPreconditions", CheckSeverity.OFF)
|
||||
check("PreferSafeLoggableExceptions", CheckSeverity.OFF)
|
||||
check("Slf4jLogsafeArgs", CheckSeverity.OFF)
|
||||
}
|
||||
}
|
||||
|
||||
publishPlugins.onlyIf {
|
||||
versionDetails().isCleanTag
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.errorprone.errorproneArgs += [
|
||||
'-Xep:PreferSafeLoggableExceptions:OFF',
|
||||
'-Xep:PreferSafeLoggingPreconditions:OFF',
|
||||
]
|
||||
javaVersions {
|
||||
libraryTarget = 11
|
||||
runtime = 17
|
||||
}
|
||||
|
|
5
changelog/0.12.0/pr-485.v2.yml
Normal file
5
changelog/0.12.0/pr-485.v2.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
type: improvement
|
||||
improvement:
|
||||
description: Publish to gradle plugin portal
|
||||
links:
|
||||
- https://github.com/palantir/gradle-graal/pull/485
|
5
changelog/0.8.0/pr-432.v2.yml
Normal file
5
changelog/0.8.0/pr-432.v2.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
type: feature
|
||||
feature:
|
||||
description: Support Java 16 for GraalVM 21.1.0 and greater
|
||||
links:
|
||||
- https://github.com/palantir/gradle-graal/pull/432
|
|
@ -1,2 +1,8 @@
|
|||
org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
|
||||
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
|
||||
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
|
||||
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
|
||||
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
|
||||
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
com.palantir.baseline-versions.disable = true
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
/*
|
||||
* (c) Copyright 2018 Palantir Technologies Inc. All rights reserved.
|
||||
*
|
||||
* Licensed 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: 'com.jfrog.bintray'
|
||||
|
||||
bintray {
|
||||
user = System.env.BINTRAY_USERNAME
|
||||
key = System.env.BINTRAY_PASSWORD
|
||||
publish = true
|
||||
pkg {
|
||||
repo = 'releases'
|
||||
name = rootProject.name
|
||||
userOrg = 'palantir'
|
||||
licenses = ['Apache-2.0']
|
||||
publications = ['nebula']
|
||||
}
|
||||
}
|
||||
|
||||
publish.dependsOn bintrayUpload
|
||||
bintrayUpload.onlyIf {
|
||||
versionDetails().isCleanTag
|
||||
}
|
||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,5 +1,6 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
|
||||
networkTimeout=10000
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
286
gradlew
vendored
286
gradlew
vendored
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
@ -17,78 +17,113 @@
|
|||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
@ -97,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
|
|||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
|
@ -105,84 +140,105 @@ location of your Java installation."
|
|||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
|
38
gradlew.bat
vendored
38
gradlew.bat
vendored
|
@ -14,7 +14,7 @@
|
|||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
|
@ -25,10 +25,14 @@
|
|||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
|
@ -37,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
|||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
@ -51,7 +55,7 @@ goto fail
|
|||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
|
@ -61,38 +65,26 @@ echo location of your Java installation.
|
|||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
|
|
@ -65,6 +65,7 @@ public abstract class BaseGraalCompileTask extends DefaultTask {
|
|||
.map(d -> d.file(outputName.get() + getArchitectureSpecifiedOutputExtension())));
|
||||
}
|
||||
|
||||
@Input
|
||||
protected abstract String getArchitectureSpecifiedOutputExtension();
|
||||
|
||||
protected final File maybeCreateOutputDirectory() throws IOException {
|
||||
|
@ -73,6 +74,7 @@ public abstract class BaseGraalCompileTask extends DefaultTask {
|
|||
return directory;
|
||||
}
|
||||
|
||||
@Input
|
||||
protected final String getExecutable() {
|
||||
return cacheDir.get()
|
||||
.resolve(Paths.get(graalVersion.get(), javaVersion.get(), graalDirectoryName.get()))
|
||||
|
@ -266,15 +268,8 @@ public abstract class BaseGraalCompileTask extends DefaultTask {
|
|||
this.options.set(options);
|
||||
}
|
||||
|
||||
@Input
|
||||
public final ListProperty<String> getOptions() {
|
||||
return options;
|
||||
}
|
||||
|
||||
public final RegularFileProperty getJarFile() {
|
||||
return jarFile;
|
||||
}
|
||||
|
||||
public final Property<Path> getCacheDir() {
|
||||
return cacheDir;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public class DownloadGraalTask extends DefaultTask {
|
|||
setGroup(GradleGraalPlugin.TASK_GROUP);
|
||||
setDescription("Downloads and caches GraalVM binaries.");
|
||||
|
||||
onlyIf(task -> !getArchive().get().getAsFile().exists());
|
||||
onlyIf(_task -> !getArchive().get().getAsFile().exists());
|
||||
}
|
||||
|
||||
@TaskAction
|
||||
|
@ -104,7 +104,7 @@ public class DownloadGraalTask extends DefaultTask {
|
|||
}
|
||||
|
||||
private String render(String pattern) {
|
||||
final String computedJavaVersion = GraalVersionUtil.isGraalVersionGreatherThan19_3(graalVersion.get())
|
||||
final String computedJavaVersion = GraalVersionUtil.isGraalVersionGreaterOrEqualThan(graalVersion.get(), 19, 3)
|
||||
? "java" + javaVersion.get()
|
||||
: ""; // for GraalVM >= 19.3 the naming contains java8 or java11
|
||||
return pattern.replaceAll("\\[url\\]", downloadBaseUrl.get())
|
||||
|
|
|
@ -56,8 +56,8 @@ public class ExtractGraalTask extends DefaultTask {
|
|||
setDescription("Extracts GraalVM tooling from downloaded archive using the system's tar command or Gradle's"
|
||||
+ " copy method.");
|
||||
|
||||
onlyIf(task -> !getOutputDirectory().get().getAsFile().exists());
|
||||
outputDirectory.set(cacheDir.map(cd -> getProject()
|
||||
onlyIf(_task -> !getOutputDirectory().get().getAsFile().exists());
|
||||
outputDirectory.set(cacheDir.map(_cd -> getProject()
|
||||
.getLayout()
|
||||
.getProjectDirectory()
|
||||
.dir(cacheDir.get().toFile().getAbsolutePath())
|
||||
|
|
|
@ -44,7 +44,7 @@ public class GraalExtension {
|
|||
private static final String DOWNLOAD_BASE_URL_GRAAL_19_3 =
|
||||
"https://github.com/graalvm/graalvm-ce-builds/" + "releases/download/";
|
||||
private static final String DEFAULT_GRAAL_VERSION = "20.2.0";
|
||||
private static final List<String> SUPPORTED_JAVA_VERSIONS = Arrays.asList("11", "8");
|
||||
private static final List<String> SUPPORTED_JAVA_VERSIONS = Arrays.asList("17", "16", "11", "8");
|
||||
private static final String DEFAULT_JAVA_VERSION = "8";
|
||||
|
||||
private final Property<String> downloadBaseUrl;
|
||||
|
@ -215,7 +215,7 @@ public class GraalExtension {
|
|||
|
||||
public final Provider<String> getGraalDirectoryName() {
|
||||
return providerFactory.provider(() -> {
|
||||
if (GraalVersionUtil.isGraalVersionGreatherThan19_3(graalVersion.get())) {
|
||||
if (GraalVersionUtil.isGraalVersionGreaterOrEqualThan(graalVersion.get(), 19, 3)) {
|
||||
return "graalvm-ce-java" + javaVersion.get() + "-" + graalVersion.get();
|
||||
}
|
||||
return "graalvm-ce-" + graalVersion.get();
|
||||
|
@ -223,7 +223,15 @@ public class GraalExtension {
|
|||
}
|
||||
|
||||
private String getDefaultDownloadBaseUrl() {
|
||||
if (GraalVersionUtil.isGraalVersionGreatherThan19_3(graalVersion.get())) {
|
||||
if (javaVersion.get().equals("17")
|
||||
&& !GraalVersionUtil.isGraalVersionGreaterOrEqualThan(graalVersion.get(), 21, 3)) {
|
||||
throw new GradleException(
|
||||
"Unsupported GraalVM version " + graalVersion.get() + " for Java 17, needs >= 21.3.0.");
|
||||
} else if (javaVersion.get().equals("16")
|
||||
&& !GraalVersionUtil.isGraalVersionGreaterOrEqualThan(graalVersion.get(), 21, 1)) {
|
||||
throw new GradleException(
|
||||
"Unsupported GraalVM version " + graalVersion.get() + " for Java 16, needs >= 21.1.0.");
|
||||
} else if (GraalVersionUtil.isGraalVersionGreaterOrEqualThan(graalVersion.get(), 19, 3)) {
|
||||
return DOWNLOAD_BASE_URL_GRAAL_19_3;
|
||||
} else if (!javaVersion.get().equals("8")) {
|
||||
throw new GradleException("Unsupported Java version for GraalVM version.");
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
package com.palantir.gradle.graal;
|
||||
|
||||
public final class GraalVersionUtil {
|
||||
public static boolean isGraalVersionGreatherThan19_3(String graalVersion) {
|
||||
public static boolean isGraalVersionGreaterOrEqualThan(String graalVersion, int majorVersion, int minorVersion) {
|
||||
try {
|
||||
final String[] versionSplit = graalVersion.split("\\.", -1);
|
||||
final int majorVersion = Integer.valueOf(versionSplit[0]);
|
||||
final int minorVersion = Integer.valueOf(versionSplit[1]);
|
||||
return majorVersion > 19 || (majorVersion == 19 && minorVersion >= 3);
|
||||
final int majorVersion0 = Integer.valueOf(versionSplit[0]);
|
||||
final int minorVersion0 = Integer.valueOf(versionSplit[1]);
|
||||
return majorVersion0 > majorVersion || (majorVersion0 == majorVersion && minorVersion0 >= minorVersion);
|
||||
} catch (NumberFormatException ignored) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
implementation-class=com.palantir.gradle.graal.GradleGraalPlugin
|
|
@ -86,6 +86,46 @@ class GradleExtensionSpec extends ProjectSpec {
|
|||
extension.getGraalDirectoryName().get() =~ "graalvm-ce-java11-19.3.0"
|
||||
}
|
||||
|
||||
def 'extension should throw exception for graalVersion 21.0.0 and Java version 16'() {
|
||||
when:
|
||||
extension.javaVersion("16")
|
||||
extension.graalVersion("21.0.0")
|
||||
extension.getDownloadBaseUrl().get()
|
||||
|
||||
then:
|
||||
thrown GradleException
|
||||
}
|
||||
|
||||
def 'extension returns the correct Graal download URL and directory name for Java version 16 and graalVersion 21.1.0'() {
|
||||
when:
|
||||
extension.javaVersion("16")
|
||||
extension.graalVersion("21.1.0")
|
||||
|
||||
then:
|
||||
extension.getDownloadBaseUrl().get() =~ "https://github.com/graalvm/graalvm-ce-builds/releases/download/"
|
||||
extension.getGraalDirectoryName().get() =~ "graalvm-ce-java16-21.1.0"
|
||||
}
|
||||
|
||||
def 'extension should throw exception for graalVersion 21.1.0 and Java version 17'() {
|
||||
when:
|
||||
extension.javaVersion("17")
|
||||
extension.graalVersion("21.1.0")
|
||||
extension.getDownloadBaseUrl().get()
|
||||
|
||||
then:
|
||||
thrown GradleException
|
||||
}
|
||||
|
||||
def 'extension returns the correct Graal download URL and directory name for Java version 17 and graalVersion 21.3.0'() {
|
||||
when:
|
||||
extension.javaVersion("17")
|
||||
extension.graalVersion("21.3.0")
|
||||
|
||||
then:
|
||||
extension.getDownloadBaseUrl().get() =~ "https://github.com/graalvm/graalvm-ce-builds/releases/download/"
|
||||
extension.getGraalDirectoryName().get() =~ "graalvm-ce-java17-21.3.0"
|
||||
}
|
||||
|
||||
def 'extension should throw exception for unsupported Java version'() {
|
||||
when:
|
||||
extension.javaVersion("12")
|
||||
|
|
|
@ -23,16 +23,26 @@ import spock.lang.Specification
|
|||
class GradleVersionUtilSpec extends Specification {
|
||||
def 'should detect Graal version 19.2.0 is not 19.3+'() {
|
||||
expect:
|
||||
!GraalVersionUtil.isGraalVersionGreatherThan19_3("19.2.0")
|
||||
!GraalVersionUtil.isGraalVersionGreaterOrEqualThan("19.2.0", 19, 3)
|
||||
}
|
||||
|
||||
def 'should detect Graal version 19.3.0 is not 19.3+'() {
|
||||
def 'should detect Graal version 19.3.0 is 19.3+'() {
|
||||
expect:
|
||||
GraalVersionUtil.isGraalVersionGreatherThan19_3("19.3.0")
|
||||
GraalVersionUtil.isGraalVersionGreaterOrEqualThan("19.3.0", 19, 3)
|
||||
}
|
||||
|
||||
def 'should detect Graal version empty is not 19.3+'() {
|
||||
expect:
|
||||
!GraalVersionUtil.isGraalVersionGreatherThan19_3("")
|
||||
!GraalVersionUtil.isGraalVersionGreaterOrEqualThan("", 19, 3)
|
||||
}
|
||||
|
||||
def 'should detect Graal version 21.1.0 is 21.1+'() {
|
||||
expect:
|
||||
GraalVersionUtil.isGraalVersionGreaterOrEqualThan("21.1.0", 21, 1)
|
||||
}
|
||||
|
||||
def 'should detect Graal version 21.0.0 is not 21.1+'() {
|
||||
expect:
|
||||
!GraalVersionUtil.isGraalVersionGreaterOrEqualThan("21.0.0", 21, 1)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,20 +2,18 @@
|
|||
|
||||
[Test dependencies]
|
||||
cglib:cglib-nodep:3.2.2 (1 constraints: 490ded24)
|
||||
com.google.code.findbugs:jsr305:3.0.2 (2 constraints: 1d0fb186)
|
||||
com.google.errorprone:error_prone_annotations:2.4.0 (2 constraints: 1d0fd486)
|
||||
com.google.guava:failureaccess:1.0.1 (1 constraints: 140ae1b4)
|
||||
com.google.guava:guava:27.0.1-jre (2 constraints: c7135868)
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava (1 constraints: bd17c918)
|
||||
com.google.j2objc:j2objc-annotations:1.1 (1 constraints: b609eba0)
|
||||
com.netflix.nebula:nebula-test:7.8.6 (1 constraints: 17052c36)
|
||||
com.netflix.nebula:nebula-test:10.2.0 (1 constraints: 35052d3b)
|
||||
com.squareup.okhttp3:mockwebserver:3.14.1 (1 constraints: 3b05423b)
|
||||
com.squareup.okhttp3:okhttp:3.14.1 (1 constraints: 680fa37c)
|
||||
com.squareup.okio:okio:1.17.2 (1 constraints: 850cc309)
|
||||
commons-io:commons-io:2.5 (1 constraints: eb0c8d0a)
|
||||
junit:junit:4.12 (2 constraints: 0c1c0d9c)
|
||||
org.checkerframework:checker-qual:2.5.3 (2 constraints: 260f6187)
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.17 (1 constraints: ed09d8aa)
|
||||
junit:junit:4.13.2 (2 constraints: 221d6f12)
|
||||
org.apiguardian:apiguardian-api:1.1.2 (2 constraints: 5523ed36)
|
||||
org.codehaus.groovy:groovy:3.0.9 (2 constraints: 241bc56d)
|
||||
org.hamcrest:hamcrest:2.2 (1 constraints: d20cdc04)
|
||||
org.hamcrest:hamcrest-core:1.3 (1 constraints: cc05fe3f)
|
||||
org.junit.platform:junit-platform-commons:1.8.1 (1 constraints: 6e119ed9)
|
||||
org.junit.platform:junit-platform-engine:1.8.1 (1 constraints: 360d1a1f)
|
||||
org.objenesis:objenesis:2.4 (1 constraints: ea0c8c0a)
|
||||
org.spockframework:spock-core:1.3-groovy-2.4 (1 constraints: 7c10f3af)
|
||||
org.opentest4j:opentest4j:1.2.0 (1 constraints: 67118bd9)
|
||||
org.spockframework:spock-core:2.1-M2-groovy-3.0 (2 constraints: e622905a)
|
||||
org.spockframework:spock-junit4:2.1-M2-groovy-3.0 (1 constraints: 241154df)
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
com.google.guava:guava = 27.0.1-jre
|
||||
com.netflix.nebula:nebula-test = 7.8.6
|
||||
com.fasterxml.jackson.core:jackson-databind = 2.13.2.1
|
||||
com.google.guava:guava = 31.1-jre
|
||||
com.netflix.nebula:nebula-test = 10.2.0
|
||||
com.squareup.okhttp3:* = 3.14.1
|
||||
|
||||
# conflict resolution
|
||||
com.google.code.findbugs:jsr305 = 3.0.2
|
||||
com.google.errorprone:error_prone_annotations = 2.4.0
|
||||
org.checkerframework:checker-qual = 2.5.3
|
||||
|
|
Loading…
Reference in a new issue