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: Kotlin Run Sample App

on: [push]

name: Kotlin 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/checkout@v6.1.0
- uses: actions/checkout@v6.1.0
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/setup-java@v6.0.0
with:
distribution: temurin
java-version: ${{ matrix.java }}
- uses: gradle/actions/setup-gradle@v6.2.0
- 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/checkout@v6.1.0
- uses: actions/checkout@v6.1.0
with:
repository: ListenNotes/podcast-api-java
ref: b697b4026f0123820459427b3579b737b592d303
path: .ci-java-sdk
- uses: actions/setup-java@v6.0.0
with:
distribution: temurin
java-version: '25'
- uses: gradle/actions/setup-gradle@v6.2.0
- 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/checkout@v6.1.0
- uses: actions/setup-java@v6.0.0
with:
distribution: temurin
java-version: '17'
- uses: gradle/actions/setup-gradle@v6.2.0
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 @@ -31,3 +31,6 @@ app/bin/

.settings/
.vscode/

.kotlin/
.ci-java-sdk/
13,298 changes: 461 additions & 12,837 deletions README.md

Large diffs are not rendered by default.

85 changes: 46 additions & 39 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,45 +1,52 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Kotlin 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 org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
id 'org.jetbrains.kotlin.jvm' version '2.1.20-RC3'

// Apply the application plugin to add support for building a CLI application in Java.
id 'org.jetbrains.kotlin.jvm' version '2.4.10'
id 'application'
}

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

repositories { mavenCentral() }
dependencies {
// Align versions of all Kotlin components
implementation platform('org.jetbrains.kotlin:kotlin-bom')

// Use the Kotlin JDK 8 standard library.
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'

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

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

// Use the Kotlin test library.
testImplementation 'org.jetbrains.kotlin:kotlin-test'

// Use the Kotlin JUnit integration.
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.4.10'
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.kotlin.demo.AppKt'
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 }
kotlin { compilerOptions { jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17; allWarningsAsErrors = true } }
application { mainClass = 'podcast.api.kotlin.demo.AppKt' }

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)^```kotlin\n(.*?)^```/)
if (snippets.size() != 31) throw new GradleException('Expected usage plus 30 generated README examples')
snippets.eachWithIndex { match, index ->
new File(output, "Example${index}.kt").text = "package readme.example${index}\n\n" + match[1]
}
}
}
sourceSets.test.kotlin.srcDir(readmeSources)
tasks.named('compileTestKotlin') { 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
}
34 changes: 34 additions & 0 deletions app/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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.
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath
org.jetbrains.kotlin:kotlin-build-tools-api:2.4.10=kotlinBuildToolsApiClasspath
org.jetbrains.kotlin:kotlin-build-tools-compat:2.4.10=kotlinBuildToolsApiClasspath
org.jetbrains.kotlin:kotlin-build-tools-cri-impl:2.4.10=kotlinBuildToolsApiClasspath
org.jetbrains.kotlin:kotlin-build-tools-impl:2.4.10=kotlinBuildToolsApiClasspath
org.jetbrains.kotlin:kotlin-compiler-embeddable:2.4.10=kotlinBuildToolsApiClasspath
org.jetbrains.kotlin:kotlin-compiler-runner:2.4.10=kotlinBuildToolsApiClasspath
org.jetbrains.kotlin:kotlin-daemon-client:2.4.10=kotlinBuildToolsApiClasspath
org.jetbrains.kotlin:kotlin-daemon-embeddable:2.4.10=kotlinBuildToolsApiClasspath
org.jetbrains.kotlin:kotlin-reflect:1.6.10=kotlinBuildToolsApiClasspath
org.jetbrains.kotlin:kotlin-script-runtime:2.4.10=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
org.jetbrains.kotlin:kotlin-scripting-common:2.4.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.4.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:2.4.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
org.jetbrains.kotlin:kotlin-scripting-jvm:2.4.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
org.jetbrains.kotlin:kotlin-stdlib:2.4.10=compileClasspath,kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-tooling-core:2.4.10=kotlinBuildToolsApiClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.0=kotlinBuildToolsApiClasspath
org.jetbrains:annotations:13.0=compileClasspath,kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
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
empty=annotationProcessor,kotlinScriptDefExtensions,testAnnotationProcessor,testKotlinScriptDefExtensions
Loading