Import, Extend, Ship
This tutorial completes the Typeflows Cycle by showing you how to import published packages, extend them with your own requirements, and ship the final configuration. You’ll import and use published Typeflows packages and include other standard files we defined in the last tutorial.
Prerequisites
- Completion of the Package and Publish tutorial
- Access to the published package from the previous tutorial
Step 1: Setup Build System
First, configure your build system with Typeflows and add the published package as a dependency:
Better Experience in Landscape Mode
The code examples look much better when viewed horizontally. Please rotate your device for the best experience!
Or view on a larger screen to see the code!
plugins {
kotlin("jvm")
id("io.typeflows") version "1.0.0"
}
repositories {
mavenCentral()
maven("https://maven.pkg.github.com/example/typeflows-standards")
}
dependencies {
implementation("io.typeflows:typeflows-github:1.0.0")
implementation("com.example:typeflows-standards:1.0.0")
}
Step 2: Create Complete Repository Configuration
Let’s create a complete repository configuration that demonstrates both importing published components and extending them with composition. This will include multiple scheduled greeting workflows and the StandardRepoFiles resource files (containing the LICENSE):
Better Experience in Landscape Mode
The code examples look much better when viewed horizontally. Please rotate your device for the best experience!
Or view on a larger screen to see the code!
class Typeflows : Builder<TypeflowsFSEntry> {
override fun build() = TypeflowsGitHubRepo {
dotGithub = DotGitHub {
workflows += ScheduledGreeting("morning", Cron.of("0 9 * * *"), "Good morning!")
workflows += ScheduledGreeting("weekend", Cron.of("0 10 * * 5"), "Happy weekend!")
}
files += StandardRepoFiles()
}
}
Step 3: Export and Verify
Run the export process to generate all your configured files:
Better Experience in Landscape Mode
The code examples look much better when viewed horizontally. Please rotate your device for the best experience!
Or view on a larger screen to see the code!
./gradlew typeflowsExport
Check the generated files to see the results of your composition:
Better Experience in Landscape Mode
The code examples look much better when viewed horizontally. Please rotate your device for the best experience!
Or view on a larger screen to see the code!
on:
schedule:
- cron: '0 9 * * *'
jobs:
greeting:
runs-on: ubuntu-latest
steps:
- name: Send greeting message
run: |
echo "Good morning!"
Conclusion
You’ve now completed the full Typeflows Cycle, demonstrating how to import published packages, extend them with your own requirements, and export the final configuration. Your repository now has imported multiple scheduled workflows and other files, all managed through type-safe configuration.