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

feat: Switch analytics config to use a zip dependency instead of local files #30

Open
wants to merge 2 commits into
base: release/v1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
!.gitignore
!.github

# Ignore Gradle temp files
# Ignore Gradle files we don't want committed
build/
/gradle.properties
config/analytics

# Ignore IntelliJ files
*/out/
Expand Down Expand Up @@ -55,4 +56,3 @@ local.properties

# Ignore generated output of mdbook for Github Pages
docs/book

6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ pipeline {
recordIssues tool: javaDoc()
//Note: Javadoc archiver only works for one directory :-(
step([$class: 'JavadocArchiver', javadocDir: 'nui/build/docs/javadoc', keepAll: false])
//recordIssues tool: checkStyle(pattern: '**/build/reports/checkstyle/*.xml')
//recordIssues tool: spotBugs(pattern: '**/build/reports/spotbugs/main/*.xml', useRankAsPriority: true)
//recordIssues tool: pmdParser(pattern: '**/build/reports/pmd/*.xml')
recordIssues tool: checkStyle(pattern: '**/build/reports/checkstyle/*.xml')
recordIssues tool: spotBugs(pattern: '**/build/reports/spotbugs/main/*.xml', useRankAsPriority: true)
recordIssues tool: pmdParser(pattern: '**/build/reports/pmd/*.xml')
recordIssues tool: taskScanner(includePattern: '**/*.java,**/*.groovy,**/*.gradle', lowTags: 'WIBNIF', normalTags: 'TODO', highTags: 'ASAP')
}
}
Expand Down
59 changes: 58 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
// See gradle/common.gradle for more or less global build logic applied to the subprojects

buildscript {
repositories {
// External libs - jcenter is Bintray and is supposed to be a superset of Maven Central, but do both just in case
jcenter()
mavenCentral()
gradlePluginPortal()
}

dependencies {
//Spotbugs
classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.0.0"
}
}

plugins {
id 'idea'
// Needed for extending the "clean" task to also delete custom stuff defined here like analytics config
id "base"

id "idea"
// For the "Build and run using: Intellij IDEA | Gradle" switch
id "org.jetbrains.gradle.plugin.idea-ext" version "0.7"
}

ext {
Expand All @@ -10,4 +29,42 @@ ext {

// JOML version we're tracking
jomlVersion = "1.9.25"

dirAnalyticsConfig = 'gradle/analytics'
}

// Declare remote repositories we're interested in - library files will be fetched from here
repositories {
// Artifactory instance for our stuff and binaries not readily available elsewhere
maven {
name "Terasology Artifactory"
url "http://artifactory.terasology.org/artifactory/virtual-repo-live"
allowInsecureProtocol true // 😱
}
}

// Define configurations for analytics config
configurations {
codeAnalyticsConfig
}

dependencies {
// Config for our code analytics lives in a centralized repo: https://github.com/MovingBlocks/TeraConfig
codeAnalyticsConfig group: 'org.terasology.config', name: 'codemetrics', version: '1.3.2', ext: 'zip'
}

task extractAnalyticsConfig(type: Copy) {
description = "Extracts configuration files for our analytics from the zip we fetched as a dependency"
from {
configurations.codeAnalyticsConfig.collect {
zipTree(it)
}
}
into "$rootDir/$dirAnalyticsConfig"
}

// Include deletion of extracted stuff in the global clean task. Without the doLast it runs on *every* execution ...
clean.doLast {
new File(dirAnalyticsConfig).deleteDir()
println "Cleaned root - don't forget to re-extract stuff! 'gradlew extractAnalyticsConfig' will do so"
}
284 changes: 0 additions & 284 deletions config/checkstyle/checkstyle.xml

This file was deleted.

7 changes: 0 additions & 7 deletions config/checkstyle/suppressions.xml

This file was deleted.

Loading