Skip to content

Commit

Permalink
[ARCHETYPE-274] Add Lincense to files and validate file content
Browse files Browse the repository at this point in the history
  • Loading branch information
Giovds committed Nov 22, 2024
1 parent 32685c2 commit e980722
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,9 @@ private void processTemplates(
if (includeCondition != null && !includeCondition.isEmpty()) {
final String evaluatedCondition = evaluateExpression(context, "includeCondition", includeCondition);
if (!Boolean.parseBoolean(evaluatedCondition)) {
LOGGER.debug(String.format("Skipping fileset %s due to includeCondition: %s being: %s", fileSet, includeCondition, evaluatedCondition));
LOGGER.debug(String.format(
"Skipping fileset %s due to includeCondition: %s being: %s",
fileSet, includeCondition, evaluatedCondition));
continue;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* 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.
*/

public class App {
public static void main(String[] args) {
System.out.println("This file should not be included");
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
/*
* 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.
*/

this should be excluded: ${package}
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
/*
* 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.
*/

this should be excluded: ${package}
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
/*
* 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.
*/

this should be included: ${package}
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
/*
* 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.
*/

this should be included: ${package}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ assert includeSecondResource.exists() : "${includeSecondResource} should be pres
assert !excludeFirstResource.exists() : "${excludeFirstResource} should not be present."
assert !excludeSecondResource.exists() : "${excludeSecondResource} should not be present."


assert includeFirstResource.text.contains("com.company.myArtifactId") : "${includeFirstResource} should contain the expected content."
assert includeSecondResource.text.contains("\${package}") : "${includeSecondResource} should contain the expected content."

0 comments on commit e980722

Please sign in to comment.