Create a basic wrapper around Graal and support the native-image task
This commit is contained in:
commit
5ed8a8d140
28 changed files with 2662 additions and 0 deletions
25
.baseline/checkstyle/checkstyle-suppressions.xml
Normal file
25
.baseline/checkstyle/checkstyle-suppressions.xml
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE suppressions PUBLIC
|
||||
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
|
||||
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
|
||||
|
||||
<!-- IMPORTANT ECLIPSE NOTE: If you change this file, you must restart Eclipse
|
||||
for your changes to take effect in its Checkstyle integration. -->
|
||||
<suppressions>
|
||||
<!-- Suppress test classes -->
|
||||
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="Javadoc*" />
|
||||
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="VariableDeclarationUsageDistance" />
|
||||
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="VisibilityModifier" />
|
||||
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="AvoidStaticImport" />
|
||||
|
||||
<!-- JavadocStyle enforces existence of package-info.java package-level Javadoc; we consider this a bug. -->
|
||||
<suppress files="package-info.java" checks="JavadocStyle" />
|
||||
|
||||
<!-- non-code classes -->
|
||||
<suppress files="\.(bdr|eot|gif|gzip|jar|json|otf|png|svg|ttf|woff|zip)$" checks="FileTabCharacter" />
|
||||
<suppress files="\.(bdr|eot|gif|gzip|jar|json|otf|png|svg|ttf|woff|zip)$" checks="NewlineAtEndOfFile" />
|
||||
|
||||
<!-- Generated code should not be subjected to checkstyle. -->
|
||||
<suppress files="[/\\].*[/\\]generated.*[/\\]" checks="." />
|
||||
</suppressions>
|
437
.baseline/checkstyle/checkstyle.xml
Normal file
437
.baseline/checkstyle/checkstyle.xml
Normal file
|
@ -0,0 +1,437 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
|
||||
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<module name="Checker">
|
||||
<property name="charset" value="UTF-8"/>
|
||||
<property name="severity" value="error"/>
|
||||
|
||||
<module name="FileTabCharacter"/> <!-- Java Style Guide: Whitespace characters -->
|
||||
<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."/>
|
||||
</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."/>
|
||||
</module>
|
||||
<module name="RegexpSingleline">
|
||||
<property name="format" value="\s+$"/>
|
||||
<property name="message" value="Whitespace at end-of-line"/>
|
||||
</module>
|
||||
<module name="RegexpMultiline"> <!-- Java Style Guide: Vertical Whitespace -->
|
||||
<property name="fileExtensions" value="java"/>
|
||||
<property name="format" value="^\n\n$"/>
|
||||
<property name="message" value="Two consecutive blank lines are not permitted."/>
|
||||
</module>
|
||||
<module name="SuppressionFilter"> <!-- baseline-gradle: README.md -->
|
||||
<property name="file" value="${config_loc}/checkstyle-suppressions.xml"/>
|
||||
</module>
|
||||
<module name="SuppressWarningsFilter"/> <!-- baseline-gradle: README.md -->
|
||||
<module name="SuppressionCommentFilter"/> <!-- baseline-gradle: README.md -->
|
||||
<module name="SuppressionCommentFilter">
|
||||
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
|
||||
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
|
||||
<property name="checkFormat" value="$1"/>
|
||||
</module>
|
||||
<module name="TreeWalker">
|
||||
<module name="AbbreviationAsWordInName"> <!-- Java Style Guide: Camel case : defined -->
|
||||
<property name="ignoreFinal" value="false"/>
|
||||
<property name="allowedAbbreviationLength" value="1"/>
|
||||
</module>
|
||||
<module name="AnnotationLocation"> <!-- Java Style Guide: Annotations -->
|
||||
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
|
||||
</module>
|
||||
<module name="AnnotationLocation"> <!-- Java Style Guide: Annotations -->
|
||||
<property name="tokens" value="VARIABLE_DEF"/>
|
||||
<property name="allowSamelineMultipleAnnotations" value="true"/>
|
||||
</module>
|
||||
<module name="AnnotationUseStyle"/> <!-- Java Style Guide: Annotations -->
|
||||
<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"/>
|
||||
<property name="allowByTailComment" value="true"/>
|
||||
<property name="allowNonPrintableEscapes" value="true"/>
|
||||
</module>
|
||||
<module name="AvoidNestedBlocks"> <!-- Java Coding Guidelines: Avoid nested blocks -->
|
||||
<property name="allowInSwitchCase" value="true"/>
|
||||
</module>
|
||||
<module name="AvoidStarImport"/> <!-- Java Style Guide: No wildcard imports -->
|
||||
<module name="AvoidStaticImport"> <!-- Java Style Guide: No static imports -->
|
||||
<property name="excludes" value="
|
||||
java.util.Collections.*,
|
||||
java.util.stream.Collectors.*,
|
||||
com.palantir.logsafe.Preconditions.*,
|
||||
com.google.common.base.Preconditions.*,
|
||||
org.apache.commons.lang3.Validate.*"/>
|
||||
</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]$)"/>
|
||||
<message key="name.invalidPattern" value="Class type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="CovariantEquals"/> <!-- Java Coding Guidelines: Override ``Object#equals`` consistently -->
|
||||
<module name="DefaultComesLast"/> <!-- Java Style Guide: The default case is present -->
|
||||
<module name="EmptyBlock"> <!-- Java Style Guide: Empty blocks: documented -->
|
||||
<property name="option" value="TEXT"/>
|
||||
</module>
|
||||
<module name="EmptyCatchBlock"> <!-- Java Style Guide: Empty blocks: documented -->
|
||||
<property name="exceptionVariableName" value="expected"/>
|
||||
</module>
|
||||
<module name="EmptyForInitializerPad"/> <!-- Java Style Guide: Horizontal whitespace -->
|
||||
<module name="EmptyLineSeparator"> <!-- Java Style Guide: Source file structure -->
|
||||
<property name="tokens" value="IMPORT, CLASS_DEF, ENUM_DEF, INTERFACE_DEF, CTOR_DEF, STATIC_INIT, INSTANCE_INIT, VARIABLE_DEF"/>
|
||||
<property name="allowNoEmptyLineBetweenFields" value="true"/>
|
||||
</module>
|
||||
<module name="EmptyStatement"/> <!-- Java Style Guide: One statement per line -->
|
||||
<module name="EqualsHashCode"/>
|
||||
<module name="FallThrough"/> <!-- Java Style Guide: Fall-through: commented -->
|
||||
<module name="FileContentsHolder"/> <!-- Required for SuppressionCommentFilter -->
|
||||
<module name="FinalClass"/> <!-- Java Coding Guidelines: Private constructors -->
|
||||
<module name="GenericWhitespace"> <!-- Java Style Guide: Horizontal whitespace -->
|
||||
<message key="ws.followed" value="GenericWhitespace ''{0}'' is followed by whitespace."/>
|
||||
<message key="ws.preceded" value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
|
||||
<message key="ws.illegalFollow" value="GenericWhitespace ''{0}'' should followed by whitespace."/>
|
||||
<message key="ws.notPreceded" value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
|
||||
</module>
|
||||
<module name="HiddenField"> <!-- Java Coding Guide: Avoid shadowing -->
|
||||
<property name="ignoreConstructorParameter" value="true"/>
|
||||
<property name="ignoreSetter" value="true"/>
|
||||
<property name="setterCanReturnItsClass" value="true"/>
|
||||
</module>
|
||||
<module name="HideUtilityClassConstructor"/> <!-- Java Coding Guidelines: Private constructors -->
|
||||
<module name="IllegalImport"> <!-- Java Coding Guidelines: Use JUnit 4-style test classes and assertions -->
|
||||
<property name="illegalPkgs" value="junit.framework"/>
|
||||
<message key="import.illegal" value="Use JUnit 4-style (org.junit.*) test classes and assertions instead of JUnit 3 (junit.framework.*)."/>
|
||||
</module>
|
||||
<module name="IllegalImport"> <!-- Java Coding Guidelines: Import the canonical package -->
|
||||
<property name="illegalPkgs" value="org.elasticsearch.common.base, jersey.repackaged.com.google.common, com.google.api.client.repackaged, org.apache.hadoop.thirdparty.guava, com.clearspring.analytics.util, org.spark_project.guava"/>
|
||||
<message key="import.illegal" value="Must not import repackaged classes."/>
|
||||
</module>
|
||||
<module name="IllegalImport">
|
||||
<property name="illegalPkgs" value="^org\.gradle\..*internal"/>
|
||||
<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">
|
||||
<property name="illegalPkgs" value="sun"/>
|
||||
<message key="import.illegal" value="Must not use Oracle's Java implementation details. See http://www.oracle.com/technetwork/java/faq-sun-packages-142232.html ."/>
|
||||
</module>
|
||||
<module name="IllegalImport">
|
||||
<property name="illegalPkgs" value="org.apache.commons.lang"/>
|
||||
<message key="import.illegal" value="lang is deprecated, use lang3 instead."/>
|
||||
</module>
|
||||
<module name="IllegalImport">
|
||||
<property name="illegalPkgs" value="org.apache.commons.math"/>
|
||||
<message key="import.illegal" value="math is deprecated, use math3 instead."/>
|
||||
</module>
|
||||
<module name="IllegalImport">
|
||||
<property name="illegalPkgs" value="org.apache.log4j, org.apache.logging.log4j, java.util.logging, ch.qos.logback"/>
|
||||
<message key="import.illegal" value="Use SLF4J instead of a logging framework directly."/>
|
||||
</module>
|
||||
<module name="IllegalInstantiation"> <!-- Java Coding Guidelines: Never instantiate primitive types -->
|
||||
<property name="classes" value="java.lang.Boolean"/>
|
||||
<property name="classes" value="java.lang.Byte"/>
|
||||
<property name="classes" value="java.lang.Character"/>
|
||||
<property name="classes" value="java.lang.Double"/>
|
||||
<property name="classes" value="java.lang.Float"/>
|
||||
<property name="classes" value="java.lang.Integer"/>
|
||||
<property name="classes" value="java.lang.Long"/>
|
||||
</module>
|
||||
<module name="IllegalThrows"/> <!-- Java Coding Guidelines: Throwable, Error, RuntimeException: Not declared -->
|
||||
<module name="IllegalTokenText"> <!-- Java Style Guide: Special escape sequences -->
|
||||
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
|
||||
<property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
|
||||
<property name="message" value="Avoid using corresponding octal or Unicode escape."/>
|
||||
</module>
|
||||
<module name="IllegalType"> <!-- Java Coding Guide: Limit coupling on concrete classes -->
|
||||
<property name="illegalClassNames" value="java.util.ArrayList, java.util.HashSet, java.util.HashMap, java.util.LinkedList, java.util.LinkedHashMap, java.util.LinkedHashSet, java.util.TreeSet, java.util.TreeMap, com.google.common.collect.ArrayListMultimap, com.google.common.collect.ForwardingListMultimap, com.google.common.collect.ForwardingMultimap, com.google.common.collect.ForwardingSetMultimap, com.google.common.collect.ForwardingSortedSetMultimap, com.google.common.collect.HashMultimap, com.google.common.collect.LinkedHashMultimap, com.google.common.collect.LinkedListMultimap, com.google.common.collect.TreeMultimap"/>
|
||||
</module>
|
||||
<module name="ImportOrder"> <!-- Java Style Guide: Ordering and spacing -->
|
||||
<property name="groups" value="/.*/"/>
|
||||
<property name="option" value="top"/>
|
||||
<property name="sortStaticImportsAlphabetically" value="true"/>
|
||||
</module>
|
||||
<module name="Indentation"> <!-- Java Style Guide: Block indentation: +4 spaces -->
|
||||
<property name="arrayInitIndent" value="8"/>
|
||||
<property name="lineWrappingIndentation" value="8"/>
|
||||
</module>
|
||||
<module name="InnerAssignment"/> <!-- Java Coding Guidelines: Inner assignments: Not used -->
|
||||
<module name="LeftCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style -->
|
||||
<property name="maxLineLength" value="120"/>
|
||||
</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://"/>
|
||||
</module>
|
||||
<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}''."/>
|
||||
</module>
|
||||
<module name="MethodName"> <!-- Java Style Guide: Method names -->
|
||||
<property name="format" value="^[a-z][a-zA-Z0-9_]+$"/>
|
||||
<message key="name.invalidPattern" value="Method name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="MethodParamPad"/> <!-- Java Style Guide: Horizontal whitespace -->
|
||||
<module name="MissingDeprecated"/> <!-- Java Coding Guide: Deprecate per annotation and Javadoc -->
|
||||
<module name="ModifiedControlVariable"/> <!-- Java Coding Guide: For-loop control variables: never modified -->
|
||||
<module name="ModifierOrder"/> <!-- Java Style Guide: Modifiers -->
|
||||
<module name="MultipleVariableDeclarations"/> <!-- Java Style Guide: One variable per declaration -->
|
||||
<module name="MutableException"/> <!-- Java Coding Guidelines: Exceptions: Always immutable -->
|
||||
<module name="NeedBraces"/> <!-- Java Style Guide: Braces are used where optional -->
|
||||
<module name="NoClone"/> <!-- Java Coding Guidelines: Never override Object#finalize or Object#clone -->
|
||||
<module name="NoFinalizer"/> <!-- Java Coding Guidelines: Never override Object#finalize -->
|
||||
<module name="NoLineWrap"/> <!-- Java Style Guide: No line-wrapping -->
|
||||
<module name="NoWhitespaceAfter"> <!-- Java Style Guide: Horizontal whitespace -->
|
||||
<property name="allowLineBreaks" value="false"/>
|
||||
<property name="tokens" value="BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS"/>
|
||||
</module>
|
||||
<module name="NoWhitespaceBefore"> <!-- Java Style Guide: Horizontal whitespace -->
|
||||
<property name="allowLineBreaks" value="true"/>
|
||||
</module>
|
||||
<module name="OneStatementPerLine"/> <!-- Java Style Guide: One statement per line -->
|
||||
<module name="OneTopLevelClass"/> <!-- Java Style Guide: Exactly one top-level class declaration -->
|
||||
<module name="OperatorWrap"> <!-- Java Style Guide: Where to break -->
|
||||
<property name="option" value="NL"/>
|
||||
<property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
|
||||
</module>
|
||||
<module name="OuterTypeFilename"/> <!-- Java Style Guide: File name -->
|
||||
<module name="OverloadMethodsDeclarationOrder"/> <!-- Java Style Guide: Overloads: never split -->
|
||||
<module name="PackageAnnotation"/> <!-- Java Style Guide: Package statement -->
|
||||
<module name="PackageDeclaration"/> <!-- Java Style Guide: Package statement -->
|
||||
<module name="PackageName"> <!-- Java Style Guide: Package names -->
|
||||
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
|
||||
<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 -->
|
||||
<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 -->
|
||||
<property name="format" value="assertEquals\(false,"/>
|
||||
<property name="message" value="Use assertFalse() instead."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Use appropriate assertion methods -->
|
||||
<property name="format" value="assertEquals\(null,"/>
|
||||
<property name="message" value="Use assertNull() instead."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Use appropriate assertion methods -->
|
||||
<property name="format" value="assertEquals\(true,"/>
|
||||
<property name="message" value="Use assertTrue() instead."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Use appropriate assertion methods -->
|
||||
<property name="format" value="assertFalse\(.*[!=]="/>
|
||||
<property name="message" value="Use better assertion method(s): assertEquals(), assertNull(), assertSame(), etc."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Use appropriate assertion methods -->
|
||||
<property name="format" value="assertTrue\(!"/>
|
||||
<property name="message" value="Use assertFalse()."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Use appropriate assertion methods -->
|
||||
<property name="format" value="assertTrue\(.*[!=]="/>
|
||||
<property name="message" value="Use better assertion method(s): assertEquals(), assertNull(), assertSame(), etc."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Avoid Generics clutter where possible -->
|
||||
<property name="format" value="Collections\.EMPTY_LIST"/>
|
||||
<property name="message" value="Use Collections.emptyList() or, better, ImmutableList.of()."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Avoid Generics clutter where possible -->
|
||||
<property name="format" value="Collections\.EMPTY_MAP"/>
|
||||
<property name="message" value="Use Collections.emptyMap() or, better, ImmutableMap.of()."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Avoid Generics clutter where possible -->
|
||||
<property name="format" value="Collections\.EMPTY_SET"/>
|
||||
<property name="message" value="Use Collections.emptySet() or, better, ImmutableSet.of()."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Use appropriate assertion methods -->
|
||||
<property name="format" value="CoreMatchers\.equalTo"/>
|
||||
<property name="message" value="Use Assert.assertEquals()."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Use appropriate assertion methods -->
|
||||
<property name="format" value="CoreMatchers\.notNull"/>
|
||||
<property name="message" value="Use better assertion method(s): Assert.assertEquals(), assertNull(), assertSame(), etc."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Avoid Generics clutter where possible -->
|
||||
<property name="format" value="ImmutableList\.Builder.*new ImmutableList\.Builder"/>
|
||||
<property name="message" value="Use ImmutableList.builder() for variable assignment."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Avoid Generics clutter where possible -->
|
||||
<property name="format" value="ImmutableMap\.Builder.*new ImmutableMap\.Builder"/>
|
||||
<property name="message" value="Use ImmutableMap.builder() for variable assignment."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Avoid Generics clutter where possible -->
|
||||
<property name="format" value="ImmutableSet\.Builder.*new ImmutableSet\.Builder"/>
|
||||
<property name="message" value="Use ImmutableSet.builder() for variable assignment."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Check parameters for validity -->
|
||||
<property name="format" value="Preconditions\.checkNotNull\((?!.*,)([^()]*(\(([^()]*|\(([^()]*|\([^()]*\))*\))*\)[^()]*)*)\)"/>
|
||||
<property name="message" value="Use Preconditions.checkNotNull(Object, String)."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Check parameters for validity -->
|
||||
<property name="format" value="Validate\.notNull\((?!.*,)([^()]*(\(([^()]*|\(([^()]*|\([^()]*\))*\))*\)[^()]*)*)\)"/>
|
||||
<property name="message" value="Use Validate.notNull(Object, String)."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="^\s*super\(\);"/>
|
||||
<property name="message" value="This is unnecessary; please delete."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="@return.*\.$"/>
|
||||
<property name="message" value="Please delete the period."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava"> <!-- Java Style Guide: Horizontal whitespace -->
|
||||
<property name="format" value="\s+$"/>
|
||||
<property name="message" value="Trailing whitespace is not allowed."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="\? extends Object\W"/>
|
||||
<property name="message" value="Use ? rather than ? extends Object."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="(?i)log(ger)?\.(debug|info|warn|error)\(.*%[sd]"/>
|
||||
<property name="message" value="SLF4J loggers support '{}' style formatting."/>
|
||||
<property name="ignoreComments" value="true"/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="\.printStackTrace\(\)"/>
|
||||
<property name="message" value="printStackTrace is not generally allowed."/>
|
||||
<property name="ignoreComments" value="true"/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="\bCharsets\."/>
|
||||
<property name="message" value="Use JDK StandardCharsets instead of alternatives."/>
|
||||
</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."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="\bIOUtils\.toString\("/>
|
||||
<property name="message" value="Prefer Guava''s [CharStreams,Files,Resources].toString to avoid charset/stream closing issues."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="static enum"/>
|
||||
<property name="message" value="Redundant ''static'' modifier."/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="\/\/TODO|\/\/ TODO(?!\([^()\s]+\): )"/>
|
||||
<property name="message" value="TODO format: // TODO(flastname): explanation"/>
|
||||
</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\(\))"/>
|
||||
<property name="message" value="Test setup/teardown methods are called before(), beforeClass(), after(), afterClass(), but not setUp, teardown, etc."/>
|
||||
</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"/>
|
||||
</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"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap"> <!-- Java Style Guide: Where to break -->
|
||||
<property name="tokens" value="DOT"/>
|
||||
<property name="option" value="nl"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap"> <!-- Java Style Guide: Where to break -->
|
||||
<property name="tokens" value="COMMA"/>
|
||||
<property name="option" value="EOL"/>
|
||||
</module>
|
||||
<module name="SimplifyBooleanExpression"/> <!-- Java Coding Guidelines: Keep Boolean expressions simple -->
|
||||
<module name="SimplifyBooleanReturn"/> <!-- Java Coding Guidelines: Keep Boolean expressions simple -->
|
||||
<module name="StaticVariableName"/> <!-- Java Style Guide: Naming -->
|
||||
<module name="StringLiteralEquality"/> <!-- Java Coding Guidelines: String equality: use String#equals -->
|
||||
<module name="SuperClone"/>
|
||||
<module name="SuppressWarnings">
|
||||
<property name="format" value="serial"/>
|
||||
</module>
|
||||
<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="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. -->
|
||||
|
||||
<module name="AtclauseOrder"> <!-- Java Style Guide: At-clauses -->
|
||||
<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="DesignForExtension"/> <!-- Java Coding Guidelines: Design for extension -->
|
||||
<module name="JavadocMethod"> <!-- Java Style Guide: Where Javadoc is used -->
|
||||
<property name="scope" 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 -->
|
||||
<property name="offset" value="0"/>
|
||||
</module>
|
||||
<module name="LocalFinalVariableName"/> <!-- Java Style Guide: Local variable names -->
|
||||
<module name="LocalVariableName"> <!-- Java Style Guide: Local variable names -->
|
||||
<property name="tokens" value="VARIABLE_DEF"/>
|
||||
<property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
|
||||
<property name="allowOneCharVarInForLoop" value="true"/>
|
||||
<message key="name.invalidPattern" value="Local variable name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="MethodLength"/> <!-- Java Coding Guide: Methods and functions: focused, crisp, concise -->
|
||||
<module name="MethodTypeParameterName"> <!-- Java Style Guide: Type variable names -->
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||
<message key="name.invalidPattern" value="Method type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="NestedForDepth">
|
||||
<property name="max" value="2"/>
|
||||
</module>
|
||||
<module name="NestedTryDepth"/> <!-- Java Coding Guide: Try/catch blocks: never nested -->
|
||||
<module name="NonEmptyAtclauseDescription"/> <!-- Java Style Guide: At-clauses -->
|
||||
<module name="ParameterName"> <!-- Java Style Guide: Parameter names -->
|
||||
<property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
|
||||
<message key="name.invalidPattern" value="Parameter name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="SingleLineJavadoc"/> <!-- Java Style Guide: General form -->
|
||||
<module name="SummaryJavadocCheck"> <!-- Java Coding Guidelines: Javadoc -->
|
||||
<property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
|
||||
</module>
|
||||
|
||||
<!-- Stricter checks end -->
|
||||
</module>
|
||||
</module>
|
13
.baseline/copyright/001_apache-2.0.txt
Normal file
13
.baseline/copyright/001_apache-2.0.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
(c) Copyright ${today.year} 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.
|
23
.baseline/eclipse/dynamic/dotfile.checkstyle
Normal file
23
.baseline/eclipse/dynamic/dotfile.checkstyle
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<fileset-config file-format-version="1.2.0" simple-config="false" sync-formatter="false">
|
||||
<local-check-config name="Baseline" location="${configDir}/checkstyle/checkstyle.xml" type="external" description="">
|
||||
<additional-data name="protect-config-file" value="false"/>
|
||||
</local-check-config>
|
||||
<fileset name="all" enabled="true" check-config-name="Baseline" local="true">
|
||||
<file-match-pattern match-pattern="." include-pattern="false"/>
|
||||
<file-match-pattern match-pattern=".*\\.java" include-pattern="true"/>
|
||||
<file-match-pattern match-pattern=".*\\.cfg" include-pattern="true"/>
|
||||
<file-match-pattern match-pattern=".*\\.coffee" include-pattern="true"/>
|
||||
<file-match-pattern match-pattern=".*\\.erb" include-pattern="true"/>
|
||||
<file-match-pattern match-pattern=".*\\.groovy" include-pattern="true"/>
|
||||
<file-match-pattern match-pattern=".*\\.handlebars" include-pattern="true"/>
|
||||
<file-match-pattern match-pattern=".*\\.json" include-pattern="true"/>
|
||||
<file-match-pattern match-pattern=".*\\.less" include-pattern="true"/>
|
||||
<file-match-pattern match-pattern=".*\\.pl" include-pattern="true"/>
|
||||
<file-match-pattern match-pattern=".*\\.pp" include-pattern="true"/>
|
||||
<file-match-pattern match-pattern=".*\\.sh" include-pattern="true"/>
|
||||
<file-match-pattern match-pattern=".*\\.xml" include-pattern="true"/>
|
||||
<file-match-pattern match-pattern="src/test/resources/.*" include-pattern="false"/>
|
||||
</fileset>
|
||||
</fileset-config>
|
313
.baseline/eclipse/org.eclipse.jdt.core.prefs
Normal file
313
.baseline/eclipse/org.eclipse.jdt.core.prefs
Normal file
|
@ -0,0 +1,313 @@
|
|||
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
|
||||
org.eclipse.jdt.core.codeComplete.fieldPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.fieldSuffixes=
|
||||
org.eclipse.jdt.core.codeComplete.localPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.localSuffixes=
|
||||
org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
|
||||
org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
|
||||
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
|
||||
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.annotation.nonnull=javax.annotation.Nonnull
|
||||
org.eclipse.jdt.core.compiler.annotation.nullable=javax.annotation.CheckForNull
|
||||
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=${javaTargetVersion}
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=${javaTargetVersion}
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore
|
||||
org.eclipse.jdt.core.compiler.processAnnotations=enabled
|
||||
org.eclipse.jdt.core.compiler.source=${javaSourceVersion}
|
||||
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_assignment=32
|
||||
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
|
||||
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
|
||||
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
|
||||
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
|
||||
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
|
||||
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_header=false
|
||||
org.eclipse.jdt.core.formatter.comment.format_html=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_source_code=true
|
||||
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
|
||||
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.comment.line_length=120
|
||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
|
||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
|
||||
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
|
||||
org.eclipse.jdt.core.formatter.compact_else_if=true
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
|
||||
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\\:off
|
||||
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\\:on
|
||||
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
|
||||
org.eclipse.jdt.core.formatter.indent_empty_lines=false
|
||||
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
|
||||
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
|
||||
org.eclipse.jdt.core.formatter.indentation.size=4
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
|
||||
org.eclipse.jdt.core.formatter.join_wrapped_lines=false
|
||||
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
||||
org.eclipse.jdt.core.formatter.lineSplit=120
|
||||
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
||||
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
|
||||
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
|
||||
org.eclipse.jdt.core.formatter.tabulation.char=space
|
||||
org.eclipse.jdt.core.formatter.tabulation.size=4
|
||||
org.eclipse.jdt.core.formatter.use_on_off_tags=false
|
||||
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
|
||||
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
|
||||
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
|
||||
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
|
|
@ -0,0 +1,66 @@
|
|||
eclipse.preferences.version=1
|
||||
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
|
||||
formatter_profile=_Baseline Profile
|
||||
formatter_settings_version=12
|
||||
org.eclipse.jdt.ui.exception.name=e
|
||||
org.eclipse.jdt.ui.gettersetter.use.is=false
|
||||
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.overrideannotation=true
|
||||
org.eclipse.jdt.ui.staticondemandthreshold=99
|
||||
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
|
||||
sp_cleanup.add_missing_annotations=true
|
||||
sp_cleanup.add_missing_deprecated_annotations=true
|
||||
sp_cleanup.add_missing_methods=false
|
||||
sp_cleanup.add_missing_nls_tags=false
|
||||
sp_cleanup.add_missing_override_annotations=true
|
||||
sp_cleanup.add_missing_override_annotations_interface_methods=true
|
||||
sp_cleanup.add_serial_version_id=false
|
||||
sp_cleanup.always_use_blocks=true
|
||||
sp_cleanup.always_use_parentheses_in_expressions=false
|
||||
sp_cleanup.always_use_this_for_non_static_field_access=false
|
||||
sp_cleanup.always_use_this_for_non_static_method_access=false
|
||||
sp_cleanup.convert_to_enhanced_for_loop=false
|
||||
sp_cleanup.correct_indentation=false
|
||||
sp_cleanup.format_source_code=false
|
||||
sp_cleanup.format_source_code_changes_only=false
|
||||
sp_cleanup.make_local_variable_final=false
|
||||
sp_cleanup.make_parameters_final=false
|
||||
sp_cleanup.make_private_fields_final=true
|
||||
sp_cleanup.make_type_abstract_if_missing_method=false
|
||||
sp_cleanup.make_variable_declarations_final=false
|
||||
sp_cleanup.never_use_blocks=false
|
||||
sp_cleanup.never_use_parentheses_in_expressions=true
|
||||
sp_cleanup.on_save_use_additional_actions=true
|
||||
sp_cleanup.organize_imports=true
|
||||
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
|
||||
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
|
||||
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
|
||||
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
|
||||
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
|
||||
sp_cleanup.remove_private_constructors=true
|
||||
sp_cleanup.remove_trailing_whitespaces=true
|
||||
sp_cleanup.remove_trailing_whitespaces_all=true
|
||||
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
|
||||
sp_cleanup.remove_unnecessary_casts=true
|
||||
sp_cleanup.remove_unnecessary_nls_tags=false
|
||||
sp_cleanup.remove_unused_imports=true
|
||||
sp_cleanup.remove_unused_local_variables=false
|
||||
sp_cleanup.remove_unused_private_fields=true
|
||||
sp_cleanup.remove_unused_private_members=false
|
||||
sp_cleanup.remove_unused_private_methods=true
|
||||
sp_cleanup.remove_unused_private_types=true
|
||||
sp_cleanup.sort_members=false
|
||||
sp_cleanup.sort_members_all=false
|
||||
sp_cleanup.use_blocks=false
|
||||
sp_cleanup.use_blocks_only_for_return_and_throw=false
|
||||
sp_cleanup.use_parentheses_in_expressions=false
|
||||
sp_cleanup.use_this_for_non_static_field_access=false
|
||||
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
|
||||
sp_cleanup.use_this_for_non_static_method_access=false
|
||||
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
|
452
.baseline/idea/intellij-java-palantir-style.xml
Normal file
452
.baseline/idea/intellij-java-palantir-style.xml
Normal file
|
@ -0,0 +1,452 @@
|
|||
<project version="4">
|
||||
<component name="ProjectCodeStyleSettingsManager">
|
||||
<option name="PER_PROJECT_SETTINGS">
|
||||
<value>
|
||||
<option name="ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION" value="true" />
|
||||
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
|
||||
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
|
||||
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
|
||||
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
|
||||
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
|
||||
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
|
||||
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
|
||||
<option name="ASSIGNMENT_WRAP" value="5" />
|
||||
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
|
||||
<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="DOWHILE_BRACE_FORCE" value="3" />
|
||||
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
|
||||
<option name="EXTENDS_LIST_WRAP" value="1" />
|
||||
<option name="FOR_BRACE_FORCE" value="3" />
|
||||
<option name="FOR_STATEMENT_WRAP" value="1" />
|
||||
<option name="IF_BRACE_FORCE" value="3" />
|
||||
<option name="IMPORT_LAYOUT_TABLE">
|
||||
<value>
|
||||
<package name="" static="true" withSubpackages="true" />
|
||||
<emptyLine />
|
||||
<package name="" static="false" withSubpackages="true" />
|
||||
</value>
|
||||
</option>
|
||||
<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="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
|
||||
<value />
|
||||
</option>
|
||||
<option name="IMPORT_LAYOUT_TABLE">
|
||||
<value>
|
||||
<package name="" withSubpackages="true" static="true" />
|
||||
<emptyLine />
|
||||
<package name="" withSubpackages="true" static="false" />
|
||||
</value>
|
||||
</option>
|
||||
</GroovyCodeStyleSettings>
|
||||
<option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" />
|
||||
<option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
|
||||
<option name="JD_DO_NOT_WRAP_ONE_LINE_COMMENTS" value="true" />
|
||||
<option name="JD_KEEP_EMPTY_EXCEPTION" value="false" />
|
||||
<option name="JD_KEEP_EMPTY_PARAMETER" value="false" />
|
||||
<option name="JD_KEEP_EMPTY_RETURN" value="false" />
|
||||
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
|
||||
<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="OPTIMIZE_IMPORTS_ON_THE_FLY" value="true" />
|
||||
<option name="OTHER_INDENT_OPTIONS">
|
||||
<value>
|
||||
<option name="INDENT_SIZE" value="4" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="8" />
|
||||
<option name="TAB_SIZE" value="4" />
|
||||
<option name="USE_TAB_CHARACTER" value="false" />
|
||||
<option name="SMART_TABS" value="false" />
|
||||
<option name="LABEL_INDENT_SIZE" value="0" />
|
||||
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
|
||||
<option name="USE_RELATIVE_INDENTS" value="false" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
|
||||
<value />
|
||||
</option>
|
||||
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
|
||||
<option name="TERNARY_OPERATION_WRAP" value="1" />
|
||||
<option name="THROWS_KEYWORD_WRAP" value="1" />
|
||||
<option name="THROWS_LIST_WRAP" value="1" />
|
||||
<option name="WHILE_BRACE_FORCE" value="3" />
|
||||
<option name="WRAP_COMMENTS" value="true" />
|
||||
<codeStyleSettings language="JAVA">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="8" />
|
||||
</indentOptions>
|
||||
<option name="ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION" value="true" />
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
|
||||
<option name="ALIGN_MULTILINE_RESOURCES" value="false" />
|
||||
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
|
||||
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
|
||||
<option name="BINARY_OPERATION_WRAP" value="1" />
|
||||
<option name="BLANK_LINES_AROUND_METHOD_IN_INTERFACE" value="0" />
|
||||
<option name="CALL_PARAMETERS_WRAP" value="1" />
|
||||
<option name="DOWHILE_BRACE_FORCE" value="3" />
|
||||
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
|
||||
<option name="EXTENDS_LIST_WRAP" value="1" />
|
||||
<option name="FIELD_ANNOTATION_WRAP" value="1" />
|
||||
<option name="FOR_BRACE_FORCE" value="3" />
|
||||
<option name="FOR_STATEMENT_WRAP" value="1" />
|
||||
<option name="IF_BRACE_FORCE" value="3" />
|
||||
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
|
||||
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
|
||||
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
|
||||
<option name="KEEP_SIMPLE_CLASSES_IN_ONE_LINE" value="true" />
|
||||
<option name="KEEP_SIMPLE_METHODS_IN_ONE_LINE" value="true" />
|
||||
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
|
||||
<option name="LINE_COMMENT_ADD_SPACE" value="true" />
|
||||
<option name="METHOD_PARAMETERS_WRAP" value="1" />
|
||||
<option name="OPTIMIZE_IMPORTS_ON_THE_FLY" value="true" />
|
||||
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
|
||||
<option name="RESOURCE_LIST_WRAP" value="5" />
|
||||
<option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
|
||||
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
|
||||
<option name="TERNARY_OPERATION_WRAP" value="1" />
|
||||
<option name="THROWS_KEYWORD_WRAP" value="1" />
|
||||
<option name="THROWS_LIST_WRAP" value="1" />
|
||||
<option name="WHILE_BRACE_FORCE" value="3" />
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<FIELD>true</FIELD>
|
||||
<FINAL>true</FINAL>
|
||||
<PUBLIC>true</PUBLIC>
|
||||
<STATIC>true</STATIC>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<FIELD>true</FIELD>
|
||||
<FINAL>true</FINAL>
|
||||
<PROTECTED>true</PROTECTED>
|
||||
<STATIC>true</STATIC>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<FIELD>true</FIELD>
|
||||
<FINAL>true</FINAL>
|
||||
<PACKAGE_PRIVATE>true</PACKAGE_PRIVATE>
|
||||
<STATIC>true</STATIC>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<FIELD>true</FIELD>
|
||||
<FINAL>true</FINAL>
|
||||
<PRIVATE>true</PRIVATE>
|
||||
<STATIC>true</STATIC>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<FIELD>true</FIELD>
|
||||
<PUBLIC>true</PUBLIC>
|
||||
<STATIC>true</STATIC>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<FIELD>true</FIELD>
|
||||
<PROTECTED>true</PROTECTED>
|
||||
<STATIC>true</STATIC>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<FIELD>true</FIELD>
|
||||
<PACKAGE_PRIVATE>true</PACKAGE_PRIVATE>
|
||||
<STATIC>true</STATIC>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<FIELD>true</FIELD>
|
||||
<PRIVATE>true</PRIVATE>
|
||||
<STATIC>true</STATIC>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<INITIALIZER_BLOCK>true</INITIALIZER_BLOCK>
|
||||
<STATIC>true</STATIC>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<FIELD>true</FIELD>
|
||||
<FINAL>true</FINAL>
|
||||
<PUBLIC>true</PUBLIC>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<FIELD>true</FIELD>
|
||||
<FINAL>true</FINAL>
|
||||
<PROTECTED>true</PROTECTED>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<FIELD>true</FIELD>
|
||||
<FINAL>true</FINAL>
|
||||
<PACKAGE_PRIVATE>true</PACKAGE_PRIVATE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<FIELD>true</FIELD>
|
||||
<FINAL>true</FINAL>
|
||||
<PRIVATE>true</PRIVATE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<FIELD>true</FIELD>
|
||||
<PUBLIC>true</PUBLIC>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<FIELD>true</FIELD>
|
||||
<PROTECTED>true</PROTECTED>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<FIELD>true</FIELD>
|
||||
<PACKAGE_PRIVATE>true</PACKAGE_PRIVATE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<FIELD>true</FIELD>
|
||||
<PRIVATE>true</PRIVATE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<FIELD>true</FIELD>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<INITIALIZER_BLOCK>true</INITIALIZER_BLOCK>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<CONSTRUCTOR>true</CONSTRUCTOR>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<METHOD>true</METHOD>
|
||||
<STATIC>true</STATIC>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<METHOD>true</METHOD>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<ENUM>true</ENUM>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<INTERFACE>true</INTERFACE>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<CLASS>true</CLASS>
|
||||
<STATIC>true</STATIC>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<CLASS>true</CLASS>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<ABSTRACT>true</ABSTRACT>
|
||||
<METHOD>true</METHOD>
|
||||
<PUBLIC>true</PUBLIC>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<ABSTRACT>true</ABSTRACT>
|
||||
<METHOD>true</METHOD>
|
||||
<PROTECTED>true</PROTECTED>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<METHOD>true</METHOD>
|
||||
<PUBLIC>true</PUBLIC>
|
||||
<SYNCHRONIZED>true</SYNCHRONIZED>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<METHOD>true</METHOD>
|
||||
<PROTECTED>true</PROTECTED>
|
||||
<SYNCHRONIZED>true</SYNCHRONIZED>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<METHOD>true</METHOD>
|
||||
<PRIVATE>true</PRIVATE>
|
||||
<SYNCHRONIZED>true</SYNCHRONIZED>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="Groovy">
|
||||
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
|
||||
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
|
||||
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
|
||||
<option name="BLANK_LINES_AROUND_METHOD_IN_INTERFACE" value="0" />
|
||||
<option name="SPACE_WITHIN_BRACES" value="false" />
|
||||
<option name="CALL_PARAMETERS_WRAP" value="1" />
|
||||
<option name="METHOD_PARAMETERS_WRAP" value="1" />
|
||||
<option name="EXTENDS_LIST_WRAP" value="1" />
|
||||
<option name="THROWS_LIST_WRAP" value="1" />
|
||||
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
|
||||
<option name="THROWS_KEYWORD_WRAP" value="1" />
|
||||
<option name="BINARY_OPERATION_WRAP" value="1" />
|
||||
<option name="TERNARY_OPERATION_WRAP" value="1" />
|
||||
<option name="ASSIGNMENT_WRAP" value="1" />
|
||||
<option name="FOR_BRACE_FORCE" value="3" />
|
||||
</codeStyleSettings>
|
||||
</value>
|
||||
</option>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
</component>
|
||||
</project>
|
3
.bulldozer.yml
Normal file
3
.bulldozer.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
mode: whitelist
|
||||
strategy: squash
|
||||
deleteAfterMerge: true
|
76
.circleci/config.yml
Normal file
76
.circleci/config.yml
Normal file
|
@ -0,0 +1,76 @@
|
|||
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
|
||||
- store_test_results: { path: ~/junit }
|
||||
- store_artifacts: { path: ~/artifacts }
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
paths: [ . ]
|
||||
|
||||
check:
|
||||
docker: [{ image: 'circleci/openjdk:8-node' }]
|
||||
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: sudo apt-get update && sudo apt-get install build-essential zlib1g-dev
|
||||
- run: ./gradlew --profile --parallel --stacktrace --continue check
|
||||
- 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' }]
|
||||
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
|
||||
- store_test_results: { path: ~/junit }
|
||||
- store_artifacts: { path: ~/artifacts }
|
||||
|
||||
publish:
|
||||
docker: [{ image: 'circleci/openjdk:8-node' }]
|
||||
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" }}' }
|
||||
- deploy:
|
||||
command: ./gradlew --profile --parallel --stacktrace --continue publish
|
||||
- store_test_results: { path: ~/junit }
|
||||
- store_artifacts: { path: ~/artifacts }
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build:
|
||||
jobs:
|
||||
- compile:
|
||||
filters: { tags: { only: /.*/ } }
|
||||
|
||||
- check:
|
||||
requires: [ compile ]
|
||||
filters: { tags: { only: /.*/ } }
|
||||
|
||||
- trial-publish:
|
||||
requires: [ compile ]
|
||||
|
||||
- publish:
|
||||
requires: [ check ]
|
||||
filters: { tags: { only: /.*/ }, branches: { only: develop } }
|
||||
|
40
.gitignore
vendored
Normal file
40
.gitignore
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
# IntelliJ
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
# Eclipse
|
||||
.classpath
|
||||
.checkstyle
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
*.launch
|
||||
|
||||
# Codegen
|
||||
.generated
|
||||
.apt_generated
|
||||
generated_src/
|
||||
**/src/generated/
|
||||
|
||||
# OS X
|
||||
.DS_Store
|
||||
|
||||
# Java
|
||||
*.class
|
||||
|
||||
# Build Systems
|
||||
.gradle/
|
||||
bin/
|
||||
build/
|
||||
out/
|
||||
reports/
|
||||
|
||||
|
||||
# SublimeText + TextMate + Vim
|
||||
*.sublime-workspace
|
||||
*.sublime-project
|
||||
*.tmproj
|
||||
*.tmproject
|
||||
*.sw[op]
|
203
LICENSE
Normal file
203
LICENSE
Normal file
|
@ -0,0 +1,203 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
|
42
README.md
Normal file
42
README.md
Normal file
|
@ -0,0 +1,42 @@
|
|||
gradle-graal
|
||||
------------
|
||||
A simple wrapper around GraalVM tooling that will download and locally cache a GraalVM installation and make
|
||||
available select parts of the GraalVM compiler for use in Gradle builds.
|
||||
|
||||
To use this plugin, apply `com.palantir.graal`. See a full example in the
|
||||
[integration tests](src/test/groovy/com/palantir/gradle/graal/GradleGraalPluginIntegrationSpec.groovy).
|
||||
|
||||
Gradle Tasks
|
||||
------------
|
||||
`./gradlew nativeImage`: create a native image using GraalVM's `native-image` tool with the configuration as specified
|
||||
by the `graal` Gradle extension. Outputs are produced to `${projectDir}/build/graal/`.
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
Configure this plugin and its wrappers around GraalVM tools through the `graal` extension with the following options:
|
||||
|
||||
**General GraalVM controls**
|
||||
* `graalVersion`: the version string to use when downloading GraalVM (defaults to `1.0.0-rc5`)
|
||||
* `downloadBaseUrl`: the base download URL to use (defaults to `https://github.com/oracle/graal/releases/download/`)
|
||||
|
||||
**`native-image` controls**
|
||||
* `outputName`: the name to use for the image output
|
||||
* `mainClass`: the main class entry-point for the image to run
|
||||
|
||||
Local GraalVM Tooling Cache
|
||||
---------------------------
|
||||
We maintain a number of different repositories, and rather than re-download tooling and cache it per repository, this
|
||||
plugin maintains a central cache in the user's home directory (`~/.gradle/caches/com.palantir.graal`). Tooling artifacts
|
||||
are cached by version, so multiple projects referring to different GraalVM versions will not corrupt the cache.
|
||||
|
||||
No locking is performed to check the atomicity of changes to the cache, so users should not expect this plugin to be
|
||||
well behaved when populating the cache from parallel processes.
|
||||
|
||||
Contributions
|
||||
-------------
|
||||
Contributions are welcome. For larger feature requests or contributions, we prefer discussing the proposed change on
|
||||
a GitHub issue prior to a PR.
|
||||
|
||||
License
|
||||
-------
|
||||
This plugin is made available under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).
|
103
build.gradle
Normal file
103
build.gradle
Normal file
|
@ -0,0 +1,103 @@
|
|||
/*
|
||||
* (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.
|
||||
*/
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
gradlePluginPortal()
|
||||
maven { url "http://palantir.bintray.com/releases" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.gradle.publish:plugin-publish-plugin:0.10.0'
|
||||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
|
||||
classpath 'com.netflix.nebula:nebula-dependency-recommender:6.0.0'
|
||||
classpath 'com.netflix.nebula:nebula-publishing-plugin:8.2.0'
|
||||
classpath 'com.palantir.baseline:gradle-baseline-java:0.26.1'
|
||||
classpath 'com.palantir.configurationresolver:gradle-configuration-resolver-plugin:0.3.0'
|
||||
classpath 'gradle.plugin.com.palantir.gradle.gitversion:gradle-git-version:0.7.3'
|
||||
classpath 'gradle.plugin.com.palantir:gradle-circle-style:1.1.2'
|
||||
classpath 'gradle.plugin.org.inferred:gradle-processors:1.2.16'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
gradlePluginPortal()
|
||||
maven { url "http://palantir.bintray.com/releases" }
|
||||
}
|
||||
|
||||
apply plugin: 'com.palantir.baseline'
|
||||
apply plugin: 'com.palantir.configuration-resolver'
|
||||
apply plugin: 'com.palantir.git-version'
|
||||
apply plugin: 'nebula.dependency-recommender'
|
||||
apply plugin: 'nebula.maven-publish'
|
||||
apply plugin: 'nebula.source-jar'
|
||||
apply plugin: 'java-gradle-plugin'
|
||||
apply plugin: 'groovy'
|
||||
apply plugin: 'org.inferred.processors'
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'com.palantir.circle.style'
|
||||
|
||||
group 'com.palantir.graal'
|
||||
version gitVersion()
|
||||
|
||||
dependencies {
|
||||
compile localGroovy()
|
||||
compile gradleApi()
|
||||
|
||||
testCompile gradleTestKit()
|
||||
testCompile 'com.netflix.nebula:nebula-test'
|
||||
|
||||
baseline 'com.palantir.baseline:gradle-baseline-java-config:0.26.1@zip'
|
||||
}
|
||||
|
||||
dependencyRecommendations {
|
||||
strategy OverrideTransitives
|
||||
propertiesFile file: project.rootProject.file('versions.props')
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
resolutionStrategy {
|
||||
failOnVersionConflict()
|
||||
}
|
||||
}
|
||||
|
||||
configurations.errorprone {
|
||||
resolutionStrategy {
|
||||
force 'com.google.guava:guava:21.0'
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.compilerArgs += [
|
||||
'-Xep:Slf4jLogsafeArgs:OFF',
|
||||
]
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
// do not add new task to publish to plugins.gradle.org
|
||||
automatedPublishing = false
|
||||
|
||||
plugins {
|
||||
graal {
|
||||
id = 'com.palantir.graal'
|
||||
implementationClass = 'com.palantir.gradle.graal.GradleGraalPlugin'
|
||||
}
|
||||
}
|
||||
}
|
2
gradle.properties
Normal file
2
gradle.properties
Normal file
|
@ -0,0 +1,2 @@
|
|||
systemProp.org.gradle.internal.http.socketTimeout=600000
|
||||
systemProp.org.gradle.internal.http.connectionTimeout=600000
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
5
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
5
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
172
gradlew
vendored
Executable file
172
gradlew
vendored
Executable file
|
@ -0,0 +1,172 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# 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"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# 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
|
||||
;;
|
||||
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"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
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
|
||||
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, switch paths to Windows format before running java
|
||||
if $cygwin ; 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" ;;
|
||||
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, 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"
|
||||
|
||||
# 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")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
84
gradlew.bat
vendored
Normal file
84
gradlew.bat
vendored
Normal file
|
@ -0,0 +1,84 @@
|
|||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@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=
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
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%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="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
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
1
settings.gradle
Normal file
1
settings.gradle
Normal file
|
@ -0,0 +1 @@
|
|||
rootProject.name = 'gradle-graal'
|
112
src/main/java/com/palantir/gradle/graal/DownloadGraalTask.java
Normal file
112
src/main/java/com/palantir/gradle/graal/DownloadGraalTask.java
Normal file
|
@ -0,0 +1,112 @@
|
|||
/*
|
||||
* (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.
|
||||
*/
|
||||
|
||||
package com.palantir.gradle.graal;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import org.gradle.api.DefaultTask;
|
||||
import org.gradle.api.internal.TaskInternal;
|
||||
import org.gradle.api.provider.Provider;
|
||||
import org.gradle.api.specs.Spec;
|
||||
import org.gradle.api.tasks.Input;
|
||||
import org.gradle.api.tasks.OutputFile;
|
||||
import org.gradle.api.tasks.TaskAction;
|
||||
|
||||
/** Downloads GraalVM binaries to {@link GradleGraalPlugin#CACHE_DIR}. */
|
||||
public class DownloadGraalTask extends DefaultTask {
|
||||
|
||||
private static final String ARTIFACT_PATTERN = "[url]/vm-[version]/graalvm-ce-[version]-[os]-[arch].tar.gz";
|
||||
private static final String FILENAME_PATTERN = "graalvm-ce-[version]-[arch].tar.gz";
|
||||
|
||||
@Input private Provider<String> graalVersion;
|
||||
@Input private Provider<String> downloadBaseUrl;
|
||||
|
||||
@TaskAction
|
||||
public final void downloadGraal() throws IOException {
|
||||
Path cache = getCache();
|
||||
if (!(cache.toFile().mkdirs() || cache.toFile().exists())) {
|
||||
throw new IllegalStateException(
|
||||
"Unable to make cache directory, and the cache directory does not already exist: " + cache);
|
||||
}
|
||||
|
||||
InputStream in = new URL(render(ARTIFACT_PATTERN)).openStream();
|
||||
Files.copy(in, getOutput(), StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String getGroup() {
|
||||
return GradleGraalPlugin.TASK_GROUP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String getDescription() {
|
||||
return "Downloads and caches GraalVM binaries.";
|
||||
}
|
||||
|
||||
@OutputFile
|
||||
public final Path getOutput() {
|
||||
return getCache().resolve(render(FILENAME_PATTERN));
|
||||
}
|
||||
|
||||
/** Returns a lambda that prevents this task from running if the download target already exists in the cache. */
|
||||
@Override
|
||||
public final Spec<? super TaskInternal> getOnlyIf() {
|
||||
return spec -> !getOutput().toFile().exists();
|
||||
}
|
||||
|
||||
@SuppressWarnings("checkstyle:hiddenfield")
|
||||
public final void configure(Provider<String> graalVersion, Provider<String> downloadBaseUrl) {
|
||||
this.graalVersion = graalVersion;
|
||||
this.downloadBaseUrl = downloadBaseUrl;
|
||||
}
|
||||
|
||||
private Path getCache() {
|
||||
return GradleGraalPlugin.CACHE_DIR.resolve(graalVersion.get());
|
||||
}
|
||||
|
||||
private String render(String pattern) {
|
||||
return pattern
|
||||
.replaceAll("\\[url\\]", downloadBaseUrl.get())
|
||||
.replaceAll("\\[version\\]", graalVersion.get())
|
||||
.replaceAll("\\[os\\]", getOperatingSystem())
|
||||
.replaceAll("\\[arch\\]", getArchitecture());
|
||||
}
|
||||
|
||||
private String getOperatingSystem() {
|
||||
switch (Platform.operatingSystem()) {
|
||||
case MAC:
|
||||
return "macos";
|
||||
case LINUX:
|
||||
return "linux";
|
||||
default:
|
||||
throw new IllegalStateException("No GraalVM support for " + Platform.operatingSystem());
|
||||
}
|
||||
}
|
||||
|
||||
private String getArchitecture() {
|
||||
switch (Platform.architecture()) {
|
||||
case AMD64:
|
||||
return "amd64";
|
||||
default:
|
||||
throw new IllegalStateException("No GraalVM support for " + Platform.architecture());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* (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.
|
||||
*/
|
||||
|
||||
package com.palantir.gradle.graal;
|
||||
|
||||
import java.io.File;
|
||||
import org.gradle.api.DefaultTask;
|
||||
import org.gradle.api.provider.Provider;
|
||||
import org.gradle.api.tasks.Input;
|
||||
import org.gradle.api.tasks.TaskAction;
|
||||
|
||||
/** Extracts GraalVM tooling from downloaded tgz archive using the system's tar command. */
|
||||
public class ExtractGraalTask extends DefaultTask {
|
||||
|
||||
@Input private File inputTgz;
|
||||
@Input private Provider<String> graalVersion;
|
||||
|
||||
@TaskAction
|
||||
public final void extractGraal() {
|
||||
if (!graalVersion.isPresent()) {
|
||||
throw new IllegalStateException("extract task requires graal.graalVersion to be defined.");
|
||||
}
|
||||
|
||||
// ideally this would be a CopyTask, but through Gradle 4.9 CopyTask fails to correctly extract symlinks
|
||||
getProject().exec(spec -> {
|
||||
spec.executable("tar");
|
||||
spec.args("-xzf", inputTgz.getAbsolutePath());
|
||||
spec.workingDir(GradleGraalPlugin.CACHE_DIR.resolve(graalVersion.get()));
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String getGroup() {
|
||||
return GradleGraalPlugin.TASK_GROUP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String getDescription() {
|
||||
return "Extracts GraalVM tooling from downloaded tgz archive using the system's tar command.";
|
||||
}
|
||||
|
||||
@SuppressWarnings("checkstyle:hiddenfield")
|
||||
public final void configure(File inputTgz, Provider<String> graalVersion) {
|
||||
this.inputTgz = inputTgz;
|
||||
this.graalVersion = graalVersion;
|
||||
}
|
||||
}
|
93
src/main/java/com/palantir/gradle/graal/GraalExtension.java
Normal file
93
src/main/java/com/palantir/gradle/graal/GraalExtension.java
Normal file
|
@ -0,0 +1,93 @@
|
|||
/*
|
||||
* (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.
|
||||
*/
|
||||
|
||||
package com.palantir.gradle.graal;
|
||||
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.provider.Property;
|
||||
import org.gradle.api.provider.Provider;
|
||||
|
||||
/** Contains options and settings for tuning GraalVM use. */
|
||||
public class GraalExtension {
|
||||
|
||||
private static final String DEFAULT_DOWNLOAD_BASE_URL = "https://github.com/oracle/graal/releases/download/";
|
||||
private static final String DEFAULT_GRAAL_VERSION = "1.0.0-rc5";
|
||||
|
||||
private Property<String> downloadBaseUrl;
|
||||
private Property<String> graalVersion;
|
||||
private Property<String> mainClass;
|
||||
private Property<String> outputName;
|
||||
|
||||
public GraalExtension(Project project) {
|
||||
downloadBaseUrl = project.getObjects().property(String.class);
|
||||
graalVersion = project.getObjects().property(String.class);
|
||||
mainClass = project.getObjects().property(String.class);
|
||||
outputName = project.getObjects().property(String.class);
|
||||
|
||||
// defaults
|
||||
downloadBaseUrl.set(DEFAULT_DOWNLOAD_BASE_URL);
|
||||
graalVersion.set(DEFAULT_GRAAL_VERSION);
|
||||
}
|
||||
|
||||
public final void downloadBaseUrl(String value) {
|
||||
downloadBaseUrl.set(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the base URL to use for downloading GraalVM binaries.
|
||||
*
|
||||
* <p>Defaults to {@link #DEFAULT_DOWNLOAD_BASE_URL}.</p>
|
||||
*/
|
||||
public final Provider<String> getDownloadBaseUrl() {
|
||||
return downloadBaseUrl;
|
||||
}
|
||||
|
||||
public final void mainClass(String value) {
|
||||
mainClass.set(value);
|
||||
}
|
||||
|
||||
/** Returns the main class to use as the entry point to the generated executable file. */
|
||||
public final Provider<String> getMainClass() {
|
||||
return mainClass;
|
||||
}
|
||||
|
||||
public final void outputName(String value) {
|
||||
outputName.set(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the outputName to use for the generated executable file.
|
||||
*
|
||||
* <p>Check {@link org.gradle.api.provider.Provider#isPresent()} to determine if an override has been set.</p>
|
||||
*/
|
||||
public final Provider<String> getOutputName() {
|
||||
return outputName;
|
||||
}
|
||||
|
||||
public final void graalVersion(String value) {
|
||||
graalVersion.set(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the graalVersion of GraalVM to use.
|
||||
*
|
||||
* <p>Defaults to {@link #DEFAULT_GRAAL_VERSION}</p>
|
||||
*/
|
||||
public final Property<String> getGraalVersion() {
|
||||
return graalVersion;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* (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.
|
||||
*/
|
||||
|
||||
package com.palantir.gradle.graal;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import org.gradle.api.Plugin;
|
||||
import org.gradle.api.Project;
|
||||
|
||||
/**
|
||||
* Adds tasks to download, extract and interact with GraalVM tooling.
|
||||
*
|
||||
* <p>All tooling execution (e.g. nativeImage) will cause GraalVM tooling to download and cache if not already
|
||||
* present. Currently, GraalVM CE only supports MacOS and Linux, and, as a result, this plugin will only correctly
|
||||
* function on MacOS and Linux. The plugin will automatically select the correct architecture and error clearly
|
||||
* if the runtime architecture is not supported.</p>
|
||||
*
|
||||
* <p>Downloads are stored in ~/.gradle/caches/com.palantir.graal using the following structure:</p>
|
||||
* <pre>
|
||||
* ~/.gradle/caches/com.palantir.graal/
|
||||
* └── [version]/
|
||||
* ├── graalvm-ce-[version]/
|
||||
* │ └── [local architecture-specific GraalVM tooling]
|
||||
* └── graalvm-ce-[version]-amd64.tar.gz
|
||||
* </pre>
|
||||
*/
|
||||
public class GradleGraalPlugin implements Plugin<Project> {
|
||||
|
||||
/** Location to cache downloaded and extracted GraalVM tooling. */
|
||||
public static final Path CACHE_DIR =
|
||||
Paths.get(System.getProperty("user.home"), ".gradle", "caches", "com.palantir.graal");
|
||||
|
||||
public static final String TASK_GROUP = "Graal";
|
||||
|
||||
@Override
|
||||
public final void apply(Project project) {
|
||||
GraalExtension extension = project.getExtensions().create("graal", GraalExtension.class, project);
|
||||
|
||||
DownloadGraalTask downloadGraal = project.getTasks().create(
|
||||
"downloadGraalTooling", DownloadGraalTask.class, task -> {
|
||||
task.configure(extension.getGraalVersion(), extension.getDownloadBaseUrl());
|
||||
});
|
||||
|
||||
ExtractGraalTask extractGraal = project.getTasks().create(
|
||||
"extractGraalTooling", ExtractGraalTask.class, task -> {
|
||||
task.dependsOn(downloadGraal);
|
||||
task.configure(downloadGraal.getOutput().toFile(), extension.getGraalVersion());
|
||||
});
|
||||
|
||||
project.getTasks().create("nativeImage", NativeImageTask.class, task -> {
|
||||
task.dependsOn(extractGraal);
|
||||
task.dependsOn("jar");
|
||||
task.configure(extension.getMainClass(), extension.getOutputName(), extension.getGraalVersion());
|
||||
});
|
||||
}
|
||||
}
|
123
src/main/java/com/palantir/gradle/graal/NativeImageTask.java
Normal file
123
src/main/java/com/palantir/gradle/graal/NativeImageTask.java
Normal file
|
@ -0,0 +1,123 @@
|
|||
/*
|
||||
* (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.
|
||||
*/
|
||||
|
||||
package com.palantir.gradle.graal;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import org.gradle.api.DefaultTask;
|
||||
import org.gradle.api.provider.Provider;
|
||||
import org.gradle.api.tasks.Input;
|
||||
import org.gradle.api.tasks.TaskAction;
|
||||
|
||||
/** Runs GraalVM's native-image command with configured options and parameters. */
|
||||
public class NativeImageTask extends DefaultTask {
|
||||
|
||||
@Input private Provider<String> mainClass;
|
||||
@Input private Provider<String> outputName;
|
||||
@Input private Provider<String> graalVersion;
|
||||
|
||||
@TaskAction
|
||||
public final void nativeImage() {
|
||||
// TODO(rfink): declare classpath list as @Input in order to unlock incremental builds
|
||||
getProject().exec(spec -> {
|
||||
if (!mainClass.isPresent()) {
|
||||
throw new IllegalArgumentException("nativeImage requires graal.mainClass to be defined.");
|
||||
}
|
||||
if (!graalVersion.isPresent()) {
|
||||
throw new IllegalStateException("nativeImage requires graal.version to be defined.");
|
||||
}
|
||||
|
||||
List<String> args = new ArrayList<>();
|
||||
args.add("-cp");
|
||||
args.add(generateClasspathArgument());
|
||||
|
||||
args.add("-H:Path=" + getOutputDirectory());
|
||||
|
||||
if (outputName.isPresent()) {
|
||||
args.add("-H:Name=" + outputName.get());
|
||||
}
|
||||
|
||||
args.add(mainClass.get());
|
||||
|
||||
spec.executable(getExecutable(graalVersion.get()));
|
||||
spec.args(args);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String getGroup() {
|
||||
return GradleGraalPlugin.TASK_GROUP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String getDescription() {
|
||||
return "Runs GraalVM's native-image command with configured options and parameters.";
|
||||
}
|
||||
|
||||
private String getOutputDirectory() {
|
||||
File outputDirectory = getProject().getProjectDir().toPath().resolve(Paths.get("build", "graal")).toFile();
|
||||
|
||||
if (!(outputDirectory.mkdirs() || outputDirectory.exists())) {
|
||||
throw new IllegalStateException(
|
||||
"Output directory does not exist and cannot be created: " + outputDirectory);
|
||||
}
|
||||
|
||||
return outputDirectory.getAbsolutePath();
|
||||
}
|
||||
|
||||
private String getExecutable(String version) {
|
||||
return GradleGraalPlugin.CACHE_DIR
|
||||
.resolve(Paths.get(version, "graalvm-ce-" + version))
|
||||
.resolve(getArchitectureSpecifiedBinaryPath())
|
||||
.toFile()
|
||||
.getAbsolutePath();
|
||||
}
|
||||
|
||||
private String generateClasspathArgument() {
|
||||
Set<File> classpath = new LinkedHashSet<>();
|
||||
classpath.addAll(getProject().getConfigurations().getByName("runtimeClasspath").getFiles());
|
||||
classpath.addAll(getProject().getTasks().getByName("jar").getOutputs().getFiles().getFiles());
|
||||
|
||||
return classpath.stream()
|
||||
.map(File::getAbsolutePath)
|
||||
.collect(Collectors.joining(":"));
|
||||
}
|
||||
|
||||
@SuppressWarnings("checkstyle:hiddenfield")
|
||||
public final void configure(Provider<String> mainClass, Provider<String> outputName,
|
||||
Provider<String> graalVersion) {
|
||||
this.mainClass = mainClass;
|
||||
this.outputName = outputName;
|
||||
this.graalVersion = graalVersion;
|
||||
}
|
||||
|
||||
private Path getArchitectureSpecifiedBinaryPath() {
|
||||
switch (Platform.operatingSystem()) {
|
||||
case MAC: return Paths.get("Contents", "Home", "bin", "native-image");
|
||||
case LINUX: return Paths.get("bin", "native-image");
|
||||
default:
|
||||
throw new IllegalStateException("No GraalVM support for " + Platform.operatingSystem());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
56
src/main/java/com/palantir/gradle/graal/Platform.java
Normal file
56
src/main/java/com/palantir/gradle/graal/Platform.java
Normal file
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* (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.
|
||||
*/
|
||||
|
||||
package com.palantir.gradle.graal;
|
||||
|
||||
/** Utility methods for keying on operating system architecture and native code tooling. */
|
||||
// TODO(melliot): replace this with the Gradle-native implementations (see NativePlatform) once promoted from incubating
|
||||
public final class Platform {
|
||||
|
||||
public enum OperatingSystem {
|
||||
MAC,
|
||||
LINUX,
|
||||
WINDOWS,
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
public enum Architecture {
|
||||
AMD64,
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
public static OperatingSystem operatingSystem() {
|
||||
String os = System.getProperty("os.name").toLowerCase();
|
||||
if (os.contains("mac")) {
|
||||
return OperatingSystem.MAC;
|
||||
} else if (os.contains("linux")) {
|
||||
return OperatingSystem.LINUX;
|
||||
} else if (os.contains("win")) {
|
||||
return OperatingSystem.WINDOWS;
|
||||
}
|
||||
return OperatingSystem.UNKNOWN;
|
||||
}
|
||||
|
||||
public static Architecture architecture() {
|
||||
String arch = System.getProperty("os.arch");
|
||||
if (arch.contains("64")) {
|
||||
return Architecture.AMD64;
|
||||
}
|
||||
return Architecture.UNKNOWN;
|
||||
}
|
||||
|
||||
private Platform() {}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* (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.
|
||||
*/
|
||||
|
||||
package com.palantir.gradle.graal
|
||||
|
||||
import nebula.test.IntegrationSpec
|
||||
import nebula.test.functional.ExecutionResult
|
||||
|
||||
class GradleGraalPluginIntegrationSpec extends IntegrationSpec {
|
||||
def 'example test running a task'() {
|
||||
setup:
|
||||
new File(getProjectDir(), "src/main/java/com/palantir/test").mkdirs()
|
||||
new File(getProjectDir(), "src/main/java/com/palantir/test/Main.java") << '''
|
||||
package com.palantir.test;
|
||||
|
||||
public final class Main {
|
||||
public static final void main(String[] args) {
|
||||
System.out.println("hello, world!");
|
||||
}
|
||||
}
|
||||
'''
|
||||
|
||||
buildFile << '''
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'com.palantir.graal'
|
||||
|
||||
graal {
|
||||
mainClass "com.palantir.test.Main"
|
||||
outputName "hello-world"
|
||||
}
|
||||
'''
|
||||
|
||||
when:
|
||||
ExecutionResult result = runTasks('nativeImage')
|
||||
// capture output from Gradle runs
|
||||
println result.standardOutput
|
||||
File output = new File(getProjectDir(), "build/graal/hello-world");
|
||||
|
||||
then:
|
||||
result.success
|
||||
output.exists()
|
||||
output.getAbsolutePath().execute().text.equals("hello, world!\n")
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* (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.
|
||||
*/
|
||||
|
||||
package com.palantir.gradle.graal
|
||||
|
||||
import nebula.test.PluginProjectSpec
|
||||
|
||||
/**
|
||||
* Tests for {@link GradleGraalPlugin}.
|
||||
*/
|
||||
class GradleGraalPluginProjectSpec extends PluginProjectSpec {
|
||||
|
||||
@Override
|
||||
String getPluginName() {
|
||||
return "com.palantir.graal"
|
||||
}
|
||||
}
|
1
versions.props
Normal file
1
versions.props
Normal file
|
@ -0,0 +1 @@
|
|||
com.netflix.nebula:nebula-test = 6.7.1
|
Loading…
Reference in a new issue