Skip to content

Commit

Permalink
Convert line endings with dos2unix
Browse files Browse the repository at this point in the history
Some (but not all) code had DOS-encoded line endings (CR+LF).

Run the following command:
dos2unix $(find src -type f)
  • Loading branch information
kohlschuetter authored and slachiewicz committed Oct 27, 2023
1 parent 0285d58 commit 7502a6a
Show file tree
Hide file tree
Showing 37 changed files with 1,623 additions and 1,623 deletions.
60 changes: 30 additions & 30 deletions src/it/MOJO-2014/verify.groovy
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
def buildLog = new File(basedir, 'build.log')
assert buildLog.exists()
assert buildLog.text.contains("BUILD SUCCESS")

assert new File(basedir, 'target').exists()
assert new File(basedir, 'target/generated-sources/java-templates/org/codehaus/mojo/templating/it/Colors.java').exists()

def javaClass = new File(basedir, 'target/generated-sources/java-templates/org/codehaus/mojo/templating/it/Colors.java')

assert javaClass.text.contains('public static final String FIRST_COLOR = "red"')
assert javaClass.text.contains('public static final String SECOND_COLOR = "green"')
assert javaClass.text.contains('public static final String THIRD_COLOR = "blue"')
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
def buildLog = new File(basedir, 'build.log')
assert buildLog.exists()
assert buildLog.text.contains("BUILD SUCCESS")

assert new File(basedir, 'target').exists()
assert new File(basedir, 'target/generated-sources/java-templates/org/codehaus/mojo/templating/it/Colors.java').exists()

def javaClass = new File(basedir, 'target/generated-sources/java-templates/org/codehaus/mojo/templating/it/Colors.java')

assert javaClass.text.contains('public static final String FIRST_COLOR = "red"')
assert javaClass.text.contains('public static final String SECOND_COLOR = "green"')
assert javaClass.text.contains('public static final String THIRD_COLOR = "blue"')
42 changes: 21 additions & 21 deletions src/it/filter-main-annotation/invoker.properties
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
#

invoker.goals=clean test
invoker.buildResult = success
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
#

invoker.goals=clean test
invoker.buildResult = success
86 changes: 43 additions & 43 deletions src/it/filter-main-annotation/pom.xml
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo.templating.it</groupId>
<artifactId>simple</artifactId>
<version>1.0-specialversion</version>

<properties>
<someprop>coquinou</someprop>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>templating-maven-plugin</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<goals>
<goal>filter-sources</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>
</dependencies>
</project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo.templating.it</groupId>
<artifactId>simple</artifactId>
<version>1.0-specialversion</version>

<properties>
<someprop>coquinou</someprop>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>templating-maven-plugin</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<goals>
<goal>filter-sources</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>
</dependencies>
</project>
14 changes: 7 additions & 7 deletions src/it/filter-main-annotation/src/main/java-templates/pkg/A.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package pkg;
import org.junit.Ignore;

@Ignore("${someprop}")
public class A {
public static final String FILTER_A="${someprop}";
public static final String FILTER_B="@someprop@";
package pkg;
import org.junit.Ignore;

@Ignore("${someprop}")
public class A {
public static final String FILTER_A="${someprop}";
public static final String FILTER_B="@someprop@";
}
16 changes: 8 additions & 8 deletions src/it/filter-main-annotation/src/main/java-templates/pkg/B.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package pkg;
import org.junit.Ignore;

@Ignore( "@someprop@")
public class B {
public static final String FILTER_A="${someprop}";
public static final String FILTER_B="@someprop@";
}
package pkg;
import org.junit.Ignore;

@Ignore( "@someprop@")
public class B {
public static final String FILTER_A="${someprop}";
public static final String FILTER_B="@someprop@";
}
20 changes: 10 additions & 10 deletions src/it/filter-main-annotation/src/main/java-templates/pkg/C.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package pkg;
import org.junit.Ignore;

@Ignore(
"${someprop}" +
"@someprop@" +
"${someprop}@someprop@ @someprop@${someprop}"
)

public class C {
package pkg;
import org.junit.Ignore;

@Ignore(
"${someprop}" +
"@someprop@" +
"${someprop}@someprop@ @someprop@${someprop}"
)

public class C {
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package pkg;
import org.junit.Ignore;

/* some stupid doc
* basedir=${basedir}
*
* some new code
* et bim
*/
@Ignore("${someprop}")
public class SomeClass
{
public static final String VERSION = "<${project.version}>";
}
package pkg;
import org.junit.Ignore;

/* some stupid doc
* basedir=${basedir}
*
* some new code
* et bim
*/
@Ignore("${someprop}")
public class SomeClass
{
public static final String VERSION = "<${project.version}>";
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package pkg.some;

public class SomeOtherClass
{
public static final String POUET="${project.build.sourceEncoding}";
package pkg.some;

public class SomeOtherClass
{
public static final String POUET="${project.build.sourceEncoding}";
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package net.batmat.maven;

import pkg.some.SomeOtherClass;

// That one is impossible to do using a .properties file
// which you load for example in a static code block.
// So this is the kind of use where it comes useful.
@SuppressWarnings("for some "+pkg.SomeClass.VERSION)
public class App
{
public static void main(String[] args )
{
System.out.println("Hello World!" + pkg.some.SomeOtherClass.POUET);
System.out.println("Version:" + pkg.SomeClass.VERSION);
}
}
package net.batmat.maven;

import pkg.some.SomeOtherClass;

// That one is impossible to do using a .properties file
// which you load for example in a static code block.
// So this is the kind of use where it comes useful.
@SuppressWarnings("for some "+pkg.SomeClass.VERSION)
public class App
{
public static void main(String[] args )
{
System.out.println("Hello World!" + pkg.some.SomeOtherClass.POUET);
System.out.println("Version:" + pkg.SomeClass.VERSION);
}
}
Loading

0 comments on commit 7502a6a

Please sign in to comment.