Skip to content
Merged
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
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

15 changes: 1 addition & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,9 @@ jobs:
distribution: 'temurin'
java-version: ${{matrix.java}}

- name: Install dependencies and set up test config
shell: bash
run: |
export HOMEDIR=`pwd`

# move to parent dir of homedir to install binaries etc
cd ..

# set up jars
git clone https://github.com/kbase/jars

cd $HOMEDIR

- name: Run tests
run: |
make test-coverage
./gradlew test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
88 changes: 0 additions & 88 deletions Makefile

This file was deleted.

130 changes: 130 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
/*
* This file was generated by the Gradle 'init' task.
*/

plugins {
id 'java'
id 'jacoco'
id 'maven-publish'
}

group = 'com.github.kbase'

// TODO GRADLE move files to standard gradle layout
// TODO GRADLE update docs
// TODO GRADLE update to jitpack built auth jar (javadoc as well)
// TODO GRADLE publish w/ jitpack when auth jar pulled from jitpack
// TODO BUILD get rid of dependency on Syslog4j, 10yo abandonware w/ CVEs

repositories {
mavenCentral()
}

compileJava {
// TODO BUILD remove when we no longer support java 8, use `options.release = 11` if needed
java.sourceCompatibility = JavaVersion.VERSION_1_8
java.targetCompatibility = JavaVersion.VERSION_1_8
}

java {
withSourcesJar()
withJavadocJar()
}

test {
forkEvery = 1 // seems to fix a race condition with the logging test
testLogging {
exceptionFormat = 'full'
showStandardStreams = true
}
finalizedBy jacocoTestReport
}

jacocoTestReport {
reports {
xml.required = true
csv.required = true
}
}

javadoc {
failOnError = false // big effort to fix this one
options {
// I don't know why this isn't working, but it's not worth spending time on right now
links "https://docs.oracle.com/javase/8/docs/api/"
}
}

publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
}

sourceSets {
main {
java {
srcDirs = ["src"]
exclude '**/test/**'
exclude '**/testlogger/**'
}
}
test {
java {
srcDirs = ["src"]
include '**/test/**'
include '**/testlogger/**'
}
}
}

def fromURL = { url, name ->
File file = new File("$buildDir/download/${name}.jar")
file.parentFile.mkdirs()
if (!file.exists()) {
new URL(url).withInputStream { downloadStream ->
file.withOutputStream { fileOut ->
fileOut << downloadStream
}
}
}
files(file.absolutePath)
}

dependencies {

// using older dependencies to not force upgrades on services that might not be able to
// handle them. Need to upgrade the services and then upgrade here
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.9.9'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.9'
implementation fromURL(
'https://github.com/kbase/jars/raw/master/lib/jars/kbase/auth/kbase-auth-0.4.2.jar',
'kbase-auth-0.4.4'
)
implementation 'org.apache.commons:commons-lang3:3.1'
implementation 'org.slf4j:slf4j-api:1.7.7'
implementation 'ch.qos.logback:logback-classic:1.1.2'
implementation 'org.ini4j:ini4j:0.5.2'
implementation 'javax.servlet:servlet-api:2.5'
implementation 'joda-time:joda-time:2.2'
// TODO CODE ideally we could rewrite java-common so it didn't have a runtime dependency on
// jetty
implementation 'org.eclipse.jetty.aggregate:jetty-all:7.0.0.v20091005'
// TODO DEPS Need to rework the java common logger to not use syslog4j at all since it's
// abandonware and has a ton of CVEs, even in the newer versions.
implementation fromURL(
'https://github.com/kbase/jars/raw/master/lib/jars/syslog4j/syslog4j-0.9.46.jar',
'syslog4j-0.9.46'
)
// needed for syslog4j
implementation 'net.java.dev.jna:jna:3.4.0'

testImplementation 'junit:junit:4.9'
testImplementation 'com.google.guava:guava:18.0'
testImplementation 'org.mockito:mockito-core:3.0.0'
testImplementation 'com.github.zafarkhaja:java-semver:0.9.0'
testImplementation 'commons-io:commons-io:2.4'

}
Loading