Skip to content

Commit

Permalink
- dependencies versions bump
Browse files Browse the repository at this point in the history
- `tagEscapingStrategyColumnName` added
  • Loading branch information
koral-- committed Oct 25, 2016
1 parent 219fa0c commit 8d10743
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
sudo: false

jdk:
- oraclejdk8

script:
- ./gradlew build jacocoTestReport --info --stacktrace

after_success:
- bash <(curl -s https://codecov.io/bash)

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
directories:
- $HOME/.gradle/caches/
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### 1.0.10
- `nameColumnIndex` extension property added #23
- dependencies versions bump
- `tagEscapingStrategyColumnName` added

### 1.0.9
- task description added
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,17 @@ something already escaped in source:
* `escapeSlashes` - default=`true`, if set to false slashes (`\`) won't be escaped
* `normalizationForm` - default=[Normalizer.Form.NFC](http://docs.oracle.com/javase/8/docs/api/java/text/Normalizer.Form.html#NFC) if set to `null` Unicode normalization won't be performed, see [javadoc of Normalizer](http://docs.oracle.com/javase/8/docs/api/java/text/Normalizer.Form.html#NFC)
for more details

#### (X)HTML tags escaping
* `tagEscapingStrategy` - default=`IF_TAGS_ABSENT`, defines X(H)TML tag brackets (&lt; and &gt;) escaping strategy
possible values:
* `ALWAYS` - brackets are always escaped. Eg. "&lt;" in source becomes "&amp;lt;" in output XML
* `NEVER` - brackets are never escaped. Eg. "&lt;" in source is passed without change to output XML
* `IF_TAGS_ABSENT` - Brackets aren't escaped if text contains tags. Eg.
&lt;b&gt;bold&lt;/b&gt; will be passed without change, but "if x&lt;4 then…" becomes "if x&amp;lt;4 then…".
See [JSoup](http://jsoup.org) - library used to detect tags
* `tagEscapingStrategyColumnName` - default=unset (no column), name of the column containing non-default tag escaping strategy, if cell is non-empty then strategy
defined there is used instead of global one

#### CSV format:
* `csvStrategy` - default=`null` (library default strategy, equivalent of
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ buildscript {
}

plugins {
id 'com.gradle.plugin-publish' version '0.9.5'
id 'com.jfrog.bintray' version '1.7.1'
id 'com.gradle.plugin-publish' version '0.9.6'
id 'com.jfrog.bintray' version '1.7.2'
}

apply plugin: 'groovy'
Expand All @@ -26,9 +26,9 @@ dependencies {
compile 'org.codehaus.groovy:groovy:2.4.7'
compile 'org.marketcetera.fork:commons-csv:2.4.2'
compile 'org.apache.poi:ooxml-schemas:1.3'
compile 'org.apache.poi:poi-ooxml:3.14'
compile 'org.apache.poi:poi:3.14'
compile 'org.jsoup:jsoup:1.9.2'
compile 'org.apache.poi:poi-ooxml:3.15'
compile 'org.apache.poi:poi:3.15'
compile 'org.jsoup:jsoup:1.10.1'
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:3.5.2'
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Aug 07 03:49:40 CEST 2016
#Tue Oct 25 01:53:31 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-bin.zip
5 changes: 5 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,9 @@ function splitJvmOpts() {
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

# 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" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
6 changes: 0 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ goto fail
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
Expand All @@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class SourceInfo {
}

def reservedColumns = [config.commentColumnName, config.translatableColumnName, config.formattedColumnName]
if (config.tagEscapingStrategyColumnName != null) {
reservedColumns.add(config.tagEscapingStrategyColumnName)
}
reservedColumns.addAll(config.ignorableColumns)

header.eachWithIndex { columnName, i ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ abstract class LocalizationPluginTestBase {
void parseTestFile(String fileName) {
def config = new ConfigExtension()
config.csvFileURI = getClass().getResource(fileName).toURI()
config.tagEscapingStrategyColumnName = 'tagEscapingStrategy'
parseTestFile(config)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class ParseCSVTest extends LocalizationPluginTestBase {
void testCsvFileConfig() {
def config = new ConfigExtension()
config.csvFile = new File(getClass().getResource('valid.csv').getPath())
config.tagEscapingStrategyColumnName = 'tagEscapingStrategy'
parseTestFile(config)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name ,default ,pl ,comment ,translatable,formatted
name ,default ,pl ,comment ,translatable,formatted,tagEscapingStrategy
app ,Application, ,,false
cow[one] ,cow ,krowa
file ,File ,"Plik" ,file label ,
Expand All @@ -7,4 +7,5 @@ cow[other],cows ,krowy,comment
days[],tuesday,,,
days[],wednesday,,,

percent,%d %s,,,false,false
percent,%d %s,,,false,false
tag,<b>test</b>,,,false,false,ALWAYS

0 comments on commit 8d10743

Please sign in to comment.