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
74 changes: 60 additions & 14 deletions .github/workflows/run-sample-app.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,63 @@
name: Scala Run Sample App

on: [push]

name: Scala CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
inputs:
maven:
description: Also verify the published 3.0.0 artifact from Maven Central
type: boolean
default: false
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest

test:
strategy:
fail-fast: false
matrix:
java: ['17', '25']
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v2
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
java-version: '21'
distribution: 'adopt'
- name: Run Sample App
run: ./gradlew run
repository: ListenNotes/podcast-api-java
ref: b697b4026f0123820459427b3579b737b592d303
path: .ci-java-sdk
- uses: actions/[email protected]
with:
distribution: temurin
java-version: ${{ matrix.java }}
- uses: gradle/actions/[email protected]
- run: ./gradlew --no-daemon --include-build .ci-java-sdk check
- run: PODCAST_API_JAVA_SOURCE=.ci-java-sdk bash scripts/verify-package.sh
public-mock:
runs-on: ubuntu-24.04
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
repository: ListenNotes/podcast-api-java
ref: b697b4026f0123820459427b3579b737b592d303
path: .ci-java-sdk
- uses: actions/[email protected]
with:
distribution: temurin
java-version: '25'
- uses: gradle/actions/[email protected]
- run: ./gradlew --no-daemon --include-build .ci-java-sdk integrationTest
maven:
if: ${{ github.event_name == 'workflow_dispatch' && inputs.maven }}
runs-on: ubuntu-24.04
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
distribution: temurin
java-version: '17'
- uses: gradle/actions/[email protected]
with:
cache-disabled: true
- run: ./gradlew --no-daemon check
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ app/.project
app/.settings/
app/bin/
.vscode/

.kotlin/
.ci-java-sdk/
13,253 changes: 544 additions & 12,709 deletions README.md

Large diffs are not rendered by default.

84 changes: 47 additions & 37 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,44 +1,54 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Scala application project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/7.0/userguide/building_java_projects.html
*/

plugins {
// Apply the scala Plugin to add support for Scala.
id 'scala'

// Apply the application plugin to add support for building a CLI application in Java.
id 'application'
}

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}

repositories { mavenCentral() }
dependencies {
// Use Scala 2.13.16 in our library project
implementation 'org.scala-lang:scala-library:2.13.16'

// This dependency is used by the application.
implementation 'com.google.guava:guava:33.4.0-jre'

// Podcast API
implementation "com.listennotes:podcast-api:1.1.6"

// Use Scalatest for testing our library
testImplementation 'junit:junit:4.13.1'
testImplementation 'org.scalatest:scalatest_2.13:3.2.3'
testImplementation 'org.scalatestplus:junit-4-13_2.13:3.2.2.0'

// Need scala-xml at test runtime
testRuntimeOnly 'org.scala-lang.modules:scala-xml_2.13:1.2.0'
implementation 'org.scala-lang:scala-library:2.13.17'
implementation "${GROUP_ID}:${POM_ARTIFACT_ID}:${VERSION_NAME}"
testImplementation platform('org.junit:junit-bom:6.1.2')
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

application {
// Define the main class for the application.
mainClass = 'podcast.api.scala.demo.App'
dependencyLocking {
lockAllConfigurations()
// The exact SDK version is pinned in gradle.properties. Excluding this one
// module lets the same locks work with Maven and a --include-build checkout.
ignoredDependencies.add('com.listennotes:podcast-api')
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType(JavaCompile).configureEach { options.release = 17 }
tasks.withType(ScalaCompile).configureEach {
scalaCompileOptions.additionalParameters = ['-release:17', '-deprecation', '-feature', '-unchecked', '-Werror']
}
application { mainClass = 'podcast.api.scala.demo.App' }

def readmeSources = layout.buildDirectory.dir('generated/readme')
tasks.register('compileReadmeSources') {
inputs.file(rootProject.file('README.md'))
outputs.dir(readmeSources)
doLast {
def output = readmeSources.get().asFile
delete(output)
output.mkdirs()
def snippets = (rootProject.file('README.md').text =~ /(?ms)^```scala\n(.*?)^```/)
if (snippets.size() != 31) throw new GradleException('Expected usage plus 30 generated README examples')
snippets.eachWithIndex { match, index ->
new File(output, "Example${index}.scala").text = "package readme.example${index}\n\n" + match[1]
}
}
}
sourceSets.test.scala.srcDir(readmeSources)
tasks.named('compileTestScala') { dependsOn 'compileReadmeSources' }
tasks.named('test') { useJUnitPlatform { excludeTags 'integration' } }
tasks.register('integrationTest', Test) {
description = 'Opt-in requests to the credential-free public mock only.'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'integration' }
shouldRunAfter test
}
59 changes: 59 additions & 0 deletions app/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.eed3si9n:shaded-jawn-parser_2.13:1.3.2=zinc
com.eed3si9n:shaded-scalajson_2.13:1.0.0-M4=zinc
com.eed3si9n:sjson-new-core_2.13:0.10.1=zinc
com.eed3si9n:sjson-new-scalajson_2.13:0.10.1=zinc
com.lmax:disruptor:3.4.2=zinc
com.swoval:file-tree-views:2.1.12=zinc
io.github.java-diff-utils:java-diff-utils:4.15=zinc
net.openhft:zero-allocation-hashing:0.16=zinc
org.apache.logging.log4j:log4j-api:2.17.1=zinc
org.apache.logging.log4j:log4j-core:2.17.1=zinc
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath
org.fusesource.jansi:jansi:2.4.1=zinc
org.jline:jline-native:3.27.1=zinc
org.jline:jline-terminal-jni:3.27.1=zinc
org.jline:jline-terminal:3.27.1=zinc
org.jline:jline:3.27.1=zinc
org.json:json:20260719=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.jspecify:jspecify:1.0.0=testCompileClasspath
org.junit.jupiter:junit-jupiter-api:6.1.2=testCompileClasspath,testRuntimeClasspath
org.junit.jupiter:junit-jupiter-engine:6.1.2=testRuntimeClasspath
org.junit.jupiter:junit-jupiter-params:6.1.2=testCompileClasspath,testRuntimeClasspath
org.junit.jupiter:junit-jupiter:6.1.2=testCompileClasspath,testRuntimeClasspath
org.junit.platform:junit-platform-commons:6.1.2=testCompileClasspath,testRuntimeClasspath
org.junit.platform:junit-platform-engine:6.1.2=testRuntimeClasspath
org.junit.platform:junit-platform-launcher:6.1.2=testRuntimeClasspath
org.junit:junit-bom:6.1.2=testCompileClasspath,testRuntimeClasspath
org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath
org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc
org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc
org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc
org.scala-lang:scala-compiler:2.13.16=zinc
org.scala-lang:scala-library:2.13.16=zinc
org.scala-lang:scala-library:2.13.17=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.scala-lang:scala-reflect:2.13.16=zinc
org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc
org.scala-sbt:collections_2.13:1.11.5=zinc
org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc
org.scala-sbt:compiler-interface:1.12.0=zinc
org.scala-sbt:core-macros_2.13:1.11.5=zinc
org.scala-sbt:io_2.13:1.10.5=zinc
org.scala-sbt:launcher-interface:1.4.4=zinc
org.scala-sbt:sbinary_2.13:0.5.1=zinc
org.scala-sbt:util-control_2.13:1.11.5=zinc
org.scala-sbt:util-interface:1.11.5=zinc
org.scala-sbt:util-logging_2.13:1.11.5=zinc
org.scala-sbt:util-position_2.13:1.11.5=zinc
org.scala-sbt:util-relation_2.13:1.11.5=zinc
org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc
org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc
org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc
org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc
org.scala-sbt:zinc-core_2.13:1.12.0=zinc
org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc
org.scala-sbt:zinc-persist_2.13:1.12.0=zinc
org.scala-sbt:zinc_2.13:1.12.0=zinc
empty=annotationProcessor,scalaCompilerPlugins,testAnnotationProcessor
Loading