Skip to content

Commit

Permalink
Merge branch 'master' of github.com:HubSpot/jinjava into namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmith-hs committed Apr 20, 2021
2 parents 10bf69d + a9f70c3 commit 9d656d4
Showing 692 changed files with 29,613 additions and 6,416 deletions.
117 changes: 117 additions & 0 deletions .mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* Copyright 2007-present the original author or authors.
*
* 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.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;

public class MavenWrapperDownloader {

private static final String WRAPPER_VERSION = "0.5.5";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";

/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";

/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";

/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";

public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());

// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);

File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}

private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}

}
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar
Empty file added .prettier-java-enabled
Empty file.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
sudo: false
language: java
jdk:
- oraclejdk8
- oraclejdk11

# https://travis-ci.community/t/error-installing-oraclejdk8-expected-feature-release-number-in-range-of-9-to-14-but-got-8/3766
dist: trusty

cache:
directories:
@@ -18,5 +21,6 @@ notifications:
before_install:
- pip install --user codecov
after_success:
- travis_wait mvn validate -e
- codecov

116 changes: 116 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,121 @@
# Jinjava Releases #

### 2021-04-09 Version 2.5.7 ([Maven Central](https://search.maven.org/#artifactdetails%7Ccom.hubspot.jinjava%7Cjinjava%7C2.5.7%7Cjar)) ###
* Various PRs for support EagerTokens and two-phase rendering via ChunkResolver.
* [Preserve Raw Tags Config](https://github.com/HubSpot/jinjava/pull/518)
* [Change config name to preserveForFinalPass](https://github.com/HubSpot/jinjava/pull/520)
* [Ensure that after pushing the interpreter, it gets popped](https://github.com/HubSpot/jinjava/pull/521)
* [Python Booleans and Filter base with parsing](https://github.com/HubSpot/jinjava/pull/523)
* [toyaml/fromyaml filters](https://github.com/HubSpot/jinjava/pull/524)
* [Add ChunkResolver to partially resolve expressions](https://github.com/HubSpot/jinjava/pull/525)
* [Simply JinjavaConfig construction](https://github.com/HubSpot/jinjava/pull/528)
* [Add size limited pymaps and pylists](https://github.com/HubSpot/jinjava/pull/530)
* [Remove overrides for append and insert](https://github.com/HubSpot/jinjava/pull/536)
* [Filter upgrades to support kw params](https://github.com/HubSpot/jinjava/pull/531)
* [Check if list index is numeric before parsing to int](https://github.com/HubSpot/jinjava/pull/538)
* [Rethrow CollectionTooBigExceptions in resolver](https://github.com/HubSpot/jinjava/pull/541)
* [Add error for collection too big](https://github.com/HubSpot/jinjava/pull/550)
* [Fix args for aliased functions](https://github.com/HubSpot/jinjava/pull/551)
* [Add filter to interpret a string early](https://github.com/HubSpot/jinjava/pull/570)
* [Variable function evaluator](https://github.com/HubSpot/jinjava/pull/572)
* [Check that disabled library map isn't null](https://github.com/HubSpot/jinjava/pull/573)
* [Pyish String representations of objects](https://github.com/HubSpot/jinjava/pull/581)
* [Intial support for vsCodeTagSnippets](https://github.com/HubSpot/jinjava/pull/589)
* [Fix documentation for truncate function](https://github.com/HubSpot/jinjava/pull/594)
* [Fix bug with whitespace controls not applying properly](https://github.com/HubSpot/jinjava/pull/599)
* [Allow replace filter on non-strings](https://github.com/HubSpot/jinjava/pull/603)
* [Add function and filter to convert string to date](https://github.com/HubSpot/jinjava/pull/608)
* [Expose jinjava snippets throught the jinjava object](https://github.com/HubSpot/jinjava/pull/622)
* [Output pyish versions of objects using legacy override flag](https://github.com/HubSpot/jinjava/pull/621)
* [Trim before checking if expression is quoted](https://github.com/HubSpot/jinjava/pull/623)
* [Fix tuple parsing bug](https://github.com/HubSpot/jinjava/pull/627)
* [Fix NPE around code snippets documentation](https://github.com/HubSpot/jinjava/pull/630)

### 2020-10-07 Version 2.5.6 ([Maven Central](https://search.maven.org/#artifactdetails%7Ccom.hubspot.jinjava%7Cjinjava%7C2.5.6%7Cjar)) ###
* [Accept ip address without network prefix in ipaddr('address') filter](https://github.com/HubSpot/jinjava/pull/512)
* [Expression test parity with jinja including isIterable](https://github.com/HubSpot/jinjava/pull/510)
* [Support IN operator for dictionaries](https://github.com/HubSpot/jinjava/pull/493)
* [Disallow adding a pyMap to itself](https://github.com/HubSpot/jinjava/pull/489)
* [Disallow adding a map to itself](https://github.com/HubSpot/jinjava/pull/474)

### 2020-06-23 Version 2.5.5 ([Maven Central](https://search.maven.org/#artifactdetails%7Ccom.hubspot.jinjava%7Cjinjava%7C2.5.5%7Cjar)) ###
* [TagCycleException was thrown when rendering template that doesn't have any cycles](https://github.com/HubSpot/jinjava/pull/445)
* [Make global context thread-safe](https://github.com/HubSpot/jinjava/pull/445)
* [Defer variables used in deferred](https://github.com/HubSpot/jinjava/pull/449)
* [Check for nulls in range function](https://github.com/HubSpot/jinjava/pull/452)
* [Fix for "Equalto operator doesn't work in "or" statement (== does)"](https://github.com/HubSpot/jinjava/pull/455)

### 2020-05-01 Version 2.5.4 ([Maven Central](https://search.maven.org/#artifactdetails%7Ccom.hubspot.jinjava%7Cjinjava%7C2.5.4%7Cjar)) ###
* [Remove hacky replaceL behavior](https://github.com/HubSpot/jinjava/pull/407)
* [Add over limit to template errors](https://github.com/HubSpot/jinjava/pull/412)
* [Fix several parse errors](https://github.com/HubSpot/jinjava/pull/413)
* [Add support for Custom Token Scanner Symbols](https://github.com/HubSpot/jinjava/pull/410)
* [Remove print statements from test](https://github.com/HubSpot/jinjava/pull/417)
* [Check for null Config](https://github.com/HubSpot/jinjava/pull/418)
* [Remove reference to TokenScannerSymbols in Nodes and Tokens](https://github.com/HubSpot/jinjava/pull/419)
* [Add to host blacklist for security](https://github.com/HubSpot/jinjava/pull/426)
* [Update blacklist error message copy](https://github.com/HubSpot/jinjava/pull/428)
* [Allow ELResolver to be configured](https://github.com/HubSpot/jinjava/pull/432)
* [Add interpreter to blacklist](https://github.com/HubSpot/jinjava/pull/435)

### 2020-03-06 Version 2.5.3 ([Maven Central](https://search.maven.org/#artifactdetails%7Ccom.hubspot.jinjava%7Cjinjava%7C2.5.3%7Cjar)) ###
* [Return empty string for un-evaluated lazy expression](https://github.com/HubSpot/jinjava/pull/405)
* [Add millis precision to unixtimestamp function](https://github.com/HubSpot/jinjava/pull/399)
* [Fix implementation for slice filter](https://github.com/HubSpot/jinjava/pull/398)
* [Implement safe filter as SafeString and handle SafeString in filters, functions and expressions](https://github.com/HubSpot/jinjava/pull/394)
* [Add PyList support to ForTag](https://github.com/HubSpot/jinjava/pull/390)
* [Change DefaultFilter to implement AdvancedFilter](https://github.com/HubSpot/jinjava/pull/389)
* [Adds dict support for DefaultFilter](https://github.com/HubSpot/jinjava/pull/386)
* [Add basic deferred value support for from tag](https://github.com/HubSpot/jinjava/pull/381)
* [Fix template error line numbers](https://github.com/HubSpot/jinjava/pull/380)
* [Track dependencies in FromTag](https://github.com/HubSpot/jinjava/pull/375)
* [Lower logging level for truncate](https://github.com/HubSpot/jinjava/pull/372)
* [Handling for OutputTooBigException](https://github.com/HubSpot/jinjava/pull/371)
* [Serialize lazy expression as its underlying value](https://github.com/HubSpot/jinjava/pull/370)
* [Return image when calling toString for LazyExpression](https://github.com/HubSpot/jinjava/pull/367)
* [More supplier conversions](https://github.com/HubSpot/jinjava/pull/366)
* [Avoid tag cycles when keeping track of parent paths for blocks ](https://github.com/HubSpot/jinjava/pull/363)
* [Add python list operations to PyList](https://github.com/HubSpot/jinjava/pull/362)
* [Fix NPE with lazy expression in intermediate expression resolution](https://github.com/HubSpot/jinjava/pull/358)
* [Create new class that lazily resolves](https://github.com/HubSpot/jinjava/pull/357)
* [Upgrade map filter to advanced filter, improve error messages, and pass through args for filters](https://github.com/HubSpot/jinjava/pull/356)
* [enable more checkstyle rules](https://github.com/HubSpot/jinjava/pull/355)
* [Add codeStyleChecker](https://github.com/HubSpot/jinjava/pull/353)

### 2019-07-11 Version 2.5.2 ([Maven Central](https://search.maven.org/#artifactdetails%7Ccom.hubspot.jinjava%7Cjinjava%7C2.5.2%7Cjar)) ###
* [Add type conversion to collection expression tests](https://github.com/HubSpot/jinjava/pull/349)
* [Change initialization of JinjavaInterpreter to instantiation](https://github.com/HubSpot/jinjava/pull/347)
* [Resolve Failure on Unknown Incompatible with default filter](https://github.com/HubSpot/jinjava/pull/345)
* [Add initial support for resolving relative paths](https://github.com/HubSpot/jinjava/pull/343)
* [Add dummy object for validation mode](https://github.com/HubSpot/jinjava/pull/341)
* [Implements equals() and hashCode() methods for TemplateError](https://github.com/HubSpot/jinjava/pull/340)

### 2019-06-07 Version 2.5.1 ([Maven Central](https://search.maven.org/#artifactdetails%7Ccom.hubspot.jinjava%7Cjinjava%7C2.5.1%7Cjar)) ###
* [Support more ipaddr filters](https://github.com/HubSpot/jinjava/pull/338)
* [Upgrade to newer basepom](https://github.com/HubSpot/jinjava/pull/334)
* [Support empty bracket implicit index syntax](https://github.com/HubSpot/jinjava/pull/331)
* [Support nominative date formats](https://github.com/HubSpot/jinjava/pull/330)
* [Add a warning for unclosed comments](https://github.com/HubSpot/jinjava/pull/329)
* [Add a warning when there is no matching start tag for an end tag](https://github.com/HubSpot/jinjava/pull/326)
* [Add child dependency to parent dependencies](https://github.com/HubSpot/jinjava/pull/325)
* [Rewrite sort filter to address several problems](https://github.com/HubSpot/jinjava/pull/323)
* [Fix cycle reference during serialization](https://github.com/HubSpot/jinjava/pull/319)
* [Add support for resolving relative paths in separate files](https://github.com/HubSpot/jinjava/pull/316)
* [Return long value from int filter if over max int length](https://github.com/HubSpot/jinjava/pull/315)
* [Use type converter when evaulting 'in'](https://github.com/HubSpot/jinjava/pull/314)
* [Only add max depth error when not in validation mode](https://github.com/HubSpot/jinjava/pull/310)
* [Expand documentation factory with new fields](https://github.com/HubSpot/jinjava/pull/309)
* [Allow ability to set a max recursion depth in config](https://github.com/HubSpot/jinjava/pull/308)

### 2019-02-05 Version 2.5.0 ([Maven Central](https://search.maven.org/#artifactdetails%7Ccom.hubspot.jinjava%7Cjinjava%7C2.5.0%7Cjar)) ###
* [Render node in include tag in the same interpreter scopes](https://github.com/HubSpot/jinjava/pull/301)
* [Fix expression resolver in include and from tag](https://github.com/HubSpot/jinjava/pull/300)
* [Add root and log filters](https://github.com/HubSpot/jinjava/pull/299)
* [Update expression resolver to return null instead of blank string](https://github.com/HubSpot/jinjava/pull/296)
* [Expression resolver fixed in import tag](https://github.com/HubSpot/jinjava/pull/290)
* [Error and documentation overhaul](https://github.com/HubSpot/jinjava/pull/289)
* [Allow partial evalutation of templates](https://github.com/HubSpot/jinjava/pull/282)

### 2019-02-05 Version 2.4.15 ([Maven Central](https://search.maven.org/#artifactdetails%7Ccom.hubspot.jinjava%7Cjinjava%7C2.4.15%7Cjar)) ###
* [Upgrade format filter to advanced filter](https://github.com/HubSpot/jinjava/pull/279)
* [Allow null in string expression tests](https://github.com/HubSpot/jinjava/pull/278)
Loading

0 comments on commit 9d656d4

Please sign in to comment.