Skip to content

Commit

Permalink
Add support to run the Apache Rat plugin
Browse files Browse the repository at this point in the history
Add gradle generated files to .gitignore
  • Loading branch information
lukecwik committed Nov 17, 2017
1 parent a4d9f5f commit a9aecb6
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -2,6 +2,10 @@
# is an input to 'maven-assembly-plugin' that generates source distribution.
# This is typically in files named 'src.xml' throughout this repository.

# Ignore files generated by the Gradle build process.
.gradle/
build/

# Ignore files generated by the Maven build process.
bin/
dependency-reduced-pom.xml
Expand Down
80 changes: 80 additions & 0 deletions build.gradle
Expand Up @@ -143,6 +143,7 @@ allprojects {

buildscript {
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
Expand All @@ -155,6 +156,7 @@ buildscript {
classpath "net.ltgt.gradle:gradle-apt-plugin:0.12"
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.1"
classpath "io.spring.gradle:propdeps-plugin:0.0.9.RELEASE"
classpath "gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.3.1"
}
}

Expand Down Expand Up @@ -248,5 +250,83 @@ subprojects {
}
}

// Apply one top level rat plugin to perform any required analysis
apply plugin: "org.nosphere.apache.rat"
rat {
plainOutput = true
xmlOutput = false
htmlOutput = false
failOnError = true
excludes = [
// Exclude files generated by the Gradle build process
"**/.gradle/**",
"**/build/**",

// .gitignore: Ignore files generated by the Maven build process
"**/target/**/*",
"**/bin/**/*",
"**/dependency-reduced-pom.xml",

// .gitignore: Ignore files generated by the Python build process
"**/*.pyc",
"**/*.pyo",
"**/*.pyd",
"**/*.egg-info/**/*",
"**/.eggs/**/*",
"**/nose-*.egg/**/*",
"**/.tox/**/*",
"**/build/**/*",
"**/dist/**/*",
"**/distribute-*/**/*",
"**/env/**/*",
"sdks/python/**/*.c",
"sdks/python/**/*.so",
"sdks/python/LICENSE",
"sdks/python/NOTICE",
"sdks/python/README.md",
"sdks/python/apache_beam/portability/api/*pb2*.*",

// .gitignore: Ignore IntelliJ files.
"**/idea/**/*",
"**/*.iml",
"**/*.ipr",
"**/*.iws",

// .gitignore: Ignore Eclipse files.
"**/.classpath",
"**/.project",
"**/.factorypath",
"**/.checkstyle",
"**/.fbExcludeFilterFile",
"**/.apt_generated/**/*",
"**/.settings/**/*",

// .gitignore: Ignore Visual Studio Code files.
"**/.vscode/*/**",

// .gitignore: Hotspot VM leaves this log in a non-target directory when java crashes
"**/hs_err_pid*.log",

// .gitignore: Ignore files that end with '~', since they
// are most likely auto-save files produced by a text editor.
"**/*~",

// .gitignore: Ignore MacOSX files.
"**/.DS_Store/**/*",

// Ignore files we track but do not distribute
".github/**/*",

"**/package-list",
"**/user.avsc",
"**/test/resources/**/*.txt",
"**/test/**/.placeholder",

// Default eclipse excludes neglect subprojects

// Proto/grpc generated wrappers
"**/apache_beam/portability/api/*_pb2*.py",
"**/go/pkg/beam/model/**/*.pb.go",
]
}
check.dependsOn rat
17 changes: 17 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,3 +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.
################################################################################
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
18 changes: 18 additions & 0 deletions gradlew
@@ -1,4 +1,22 @@
#!/usr/bin/env sh
################################################################################
# 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.
################################################################################


##############################################################################
##
Expand Down
18 changes: 18 additions & 0 deletions gradlew.bat
@@ -1,3 +1,21 @@
@rem ################################################################################
@rem # Licensed to the Apache Software Foundation (ASF) under one
@rem # or more contributor license agreements. See the NOTICE file
@rem # distributed with this work for additional information
@rem # regarding copyright ownership. The ASF licenses this file
@rem # to you under the Apache License, Version 2.0 (the
@rem # "License"); you may not use this file except in compliance
@rem # with the License. You may obtain a copy of the License at
@rem #
@rem # http://www.apache.org/licenses/LICENSE-2.0
@rem #
@rem # Unless required by applicable law or agreed to in writing, software
@rem # distributed under the License is distributed on an "AS IS" BASIS,
@rem # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem # See the License for the specific language governing permissions and
@rem # limitations under the License.
@rem ################################################################################

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand Down
20 changes: 19 additions & 1 deletion settings.gradle
@@ -1,3 +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.
*/

rootProject.name = 'beam-parent'
include ':beam-sdks-java-build-tools'
include ':beam-model-parent:beam-model-pipeline'
Expand Down Expand Up @@ -143,4 +161,4 @@ project(':beam-runners-parent').projectDir = "$rootDir/runners" as File
project(':beam-examples-parent:beam-examples-java').projectDir = "$rootDir/examples/java" as File
project(':beam-examples-parent:beam-examples-java8').projectDir = "$rootDir/examples/java8" as File
project(':beam-examples-parent').projectDir = "$rootDir/examples" as File
project(':beam-sdks-java-javadoc').projectDir = "$rootDir/sdks/java/javadoc" as File
project(':beam-sdks-java-javadoc').projectDir = "$rootDir/sdks/java/javadoc" as File

0 comments on commit a9aecb6

Please sign in to comment.