Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nutch 2940 compile plugins #7

Open
wants to merge 10 commits into
base: NUTCH-2940
Choose a base branch
from
13 changes: 13 additions & 0 deletions .github/workflows/master-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
types: [opened, synchronize, reopened]


jobs:
Expand All @@ -39,3 +40,15 @@ jobs:
java-version: ${{ matrix.java }}
- name: Build with Ant
run: ant clean nightly javadoc -buildfile build.xml
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
20 changes: 20 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,26 @@ tasks.register<Sync>("resolve-default") {
into(layout.buildDirectory.dir("${project.properties["lib.dir"]}"))
}

tasks.register("test-plugins"){
dependsOn("resolve-test", "compile")

doLast {
val pluginTestDir = file("src/plugin")

// Find all JUnit test classes in the plugin test directory
val testClasses = pluginTestDir.walkTopDown().filter {
it.isFile && it.name.endsWith("Test.java")
}

// Run the tests using the JUnit platform runner
project.javaexec {
main = "org.junit.platform.console.ConsoleLauncher"
args = testClasses.map { it.path }.toList()
classpath = sourceSets.test.runtimeClasspath
}
}
}

tasks.register<Sync>("resolve-test") {
group = "gradleBuildSystem"
description = "Resolve and retrieve dependencies"
Expand Down
13 changes: 13 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sonar.projectKey=lewismc_nutch
sonar.organization=lewismc

# This is the name and version displayed in the SonarCloud UI.
sonar.projectName=Apache Nutch
sonar.projectVersion=1.19-SNAPSHOT

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
sonar.sources=.

# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
sonar.java.binaries=./build