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

refactor/gradle-setup #7

Merged
merged 11 commits into from
Oct 9, 2024
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
30 changes: 30 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
# Change these settings to your own preference
indent_style = space
indent_size = 4
continuation_indent_size = 8

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.ts]
quote_type = single
continuation_indent_size = 4

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[{package,bower}.json]
indent_size = 2
22 changes: 4 additions & 18 deletions .github/workflows/snyk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: snyk/actions/setup@master
with:
snyk-version: v1.1032.0

- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/gradle-jdk17@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: >
snyk test
--all-projects
--configuration-matching='^runtimeClasspath$'
--org=radar-base
--policy-path=$PWD/.snyk
--severity-threshold=high
with:
args: --all-projects --configuration-matching='^runtimeClasspath$' --severity-threshold=high

16 changes: 15 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
*/

import org.radarbase.gradle.plugin.radarKotlin
import org.radarbase.gradle.plugin.radarPublishing

plugins {
id("org.radarbase.radar-root-project") version Versions.radarCommons
id("org.radarbase.radar-dependency-management") version Versions.radarCommons
id("org.radarbase.radar-kotlin") version Versions.radarCommons apply false
id("org.radarbase.radar-publishing") version Versions.radarCommons apply false
kotlin("plugin.serialization") version Versions.kotlin apply false
kotlin("plugin.noarg") version Versions.kotlin apply false
kotlin("plugin.jpa") version Versions.kotlin apply false
Expand All @@ -30,11 +32,11 @@ plugins {

radarRootProject {
projectVersion.set(Versions.project)
gradleVersion.set(Versions.gradle)
}

subprojects {
apply(plugin = "org.radarbase.radar-kotlin")
apply(plugin = "org.radarbase.radar-publishing")

radarKotlin {
javaVersion.set(Versions.java)
Expand All @@ -43,4 +45,16 @@ subprojects {
log4j2Version.set(Versions.log4j2)
junitVersion.set(Versions.junit)
}

radarPublishing {
githubUrl.set("https://github.com/RADAR-base/radar-data-dashboard-backend")
developers {
developer {
id.set("pvanierop")
name.set("Pim van Nierop")
email.set("[email protected]")
organization.set("radar-base")
}
}
}
}
7 changes: 3 additions & 4 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

@Suppress("ConstPropertyName")
object Versions {
const val project = "4.4.1"
const val project = "0.1.8"

const val java = 17

const val kotlin = "1.9.10"

const val radarCommons = "1.1.1"
const val radarCommons = "1.1.2"
const val radarJersey = "0.10.0"
const val postgresql = "42.6.0"
const val ktor = "2.3.5"
Expand All @@ -37,6 +37,5 @@ object Versions {
const val junit = "5.10.0"
const val mockitoKotlin = "5.1.0"
const val hamcrest = "2.2"

const val gradle = "8.4"
const val ktlint = "1.3.1"
}
1 change: 0 additions & 1 deletion data-dashboard-backend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ application {
}

dependencies {
api(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))

implementation("org.radarbase:radar-jersey:${Versions.radarJersey}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ import org.slf4j.Logger
import org.slf4j.LoggerFactory
import kotlin.system.exitProcess

object Main {
object DashboardApi {

init {
System.setProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager")
}
private val logger: Logger = LoggerFactory.getLogger(Main.javaClass)

private val logger: Logger = LoggerFactory.getLogger(DashboardApi.javaClass)

@JvmStatic
fun main(args: Array<String>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import org.glassfish.jersey.test.ServletDeploymentContext
import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory
import org.glassfish.jersey.test.spi.TestContainerFactory
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.radarbase.datadashboard.api.config.DashboardApiConfig
import org.radarbase.datadashboard.api.resource.ObservationResource
Expand Down Expand Up @@ -70,12 +71,14 @@ class DashboardIntegrationTest : JerseyTest() {
Assertions.assertEquals(200, response.status)
}

@Disabled("Token integration tests do not work yet.")
@Test
fun testGetObservationsNoToken() {
val response = target("project/project-1/subject/sub-1/topic/phone_battery_level/observations").request().get()
Assertions.assertEquals(401, response.status)
}

@Disabled("Token integration tests do not work yet.")
@Test
fun testGetObservationsWithToken() {
val response = target("project/project-1/subject/sub-1/topic/phone_battery_level/observations")
Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.
Loading