Compare commits
4 Commits
1fd3fa8907
...
v0.1.0
Author | SHA1 | Date | |
---|---|---|---|
ca221f1907
|
|||
e83b313766
|
|||
1c5cafb04d
|
|||
71d98e540b |
11
.github/workflows/publish.yaml
vendored
11
.github/workflows/publish.yaml
vendored
@@ -1,11 +1,8 @@
|
|||||||
name: Publish Workflow
|
name: Publish Workflow
|
||||||
on:
|
on:
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
push:
|
push:
|
||||||
branches:
|
tags:
|
||||||
- main
|
- v*
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
name: Publish library
|
name: Publish library
|
||||||
@@ -33,11 +30,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
export VERSION="$(echo ${{ github.ref_name }} | cut -c2-)"
|
export VERSION="$(echo ${{ github.ref_name }} | cut -c2-)"
|
||||||
echo "Parsed version: '$VERSION'"
|
echo "Parsed version: '$VERSION'"
|
||||||
echo "tinyvm_version=$VERSION" >> "$GITHUB_OUTPUT"
|
echo "filesystem_version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Publish to Gitea package repository
|
- name: Publish to Gitea package repository
|
||||||
env:
|
env:
|
||||||
TINYVM_VERSION: ${{ steps.parse.outputs.tinyvm_version }}
|
FILESYSTEM_VERSION: ${{ steps.parse.outputs.filesystem_version }}
|
||||||
GITEA_USERNAME: ${{ github.repository_owner }}
|
GITEA_USERNAME: ${{ github.repository_owner }}
|
||||||
GITEA_TOKEN: ${{ secrets.deploy_token }}
|
GITEA_TOKEN: ${{ secrets.deploy_token }}
|
||||||
run: ./gradlew publishAllPublicationsToGiteaRepository
|
run: ./gradlew publishAllPublicationsToGiteaRepository
|
22
README.md
22
README.md
@@ -3,6 +3,28 @@
|
|||||||
This is a small project to make a very basic filesystem library in Kotlin and was created using the instructions below
|
This is a small project to make a very basic filesystem library in Kotlin and was created using the instructions below
|
||||||
as part of my application to the JetBrains internship project "TeamCity Kotlin Script build step extension library".
|
as part of my application to the JetBrains internship project "TeamCity Kotlin Script build step extension library".
|
||||||
|
|
||||||
|
The package is (very creatively) named `filesystem`.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Gradle
|
||||||
|
```kotlin
|
||||||
|
repositories {
|
||||||
|
// other repositories
|
||||||
|
maven { url "https://git.koval.net/api/packages/cyclane/maven" }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
// other dependencies
|
||||||
|
implementation("net.koval.teamcity-build-step-extension-test-task:filesystem:0.1.0")
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
Use autocompletion and hover menus in your IDE, or download the
|
||||||
|
[generated HTML documentation](https://git.koval.net/cyclane/teamcity-build-step-extension-test-task/releases/download/v0.1.0/filesystem-0.1.0-javadoc.zip)
|
||||||
|
from the [latest release](https://git.koval.net/cyclane/teamcity-build-step-extension-test-task/releases).
|
||||||
|
|
||||||
## Instructions
|
## Instructions
|
||||||
|
|
||||||
Create a library implementing four classes:
|
Create a library implementing four classes:
|
||||||
|
@@ -6,7 +6,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "net.koval.teamcity-build-step-extension-test-task"
|
group = "net.koval.teamcity-build-step-extension-test-task"
|
||||||
version = "0.0.0"
|
version = System.getenv("FILESYSTEM_VERSION")
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
@@ -6,7 +6,9 @@ import java.nio.file.Files
|
|||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
|
|
||||||
class FSCreator {
|
class FSCreator {
|
||||||
// Create entry, leaving existing folders' contents, but overwriting existing files.
|
/**
|
||||||
|
* Create entry, leaving existing folders' contents, but overwriting existing files.
|
||||||
|
*/
|
||||||
@Throws(FileSystemException::class)
|
@Throws(FileSystemException::class)
|
||||||
fun create(
|
fun create(
|
||||||
entryToCreate: FSEntry,
|
entryToCreate: FSEntry,
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
package filesystem
|
package filesystem
|
||||||
|
|
||||||
// Note sealed allows for simpler logic in FSCreator by guaranteeing FSFile and FSFolder are the only possible FSEntries
|
// Note sealed allows for simpler logic in FSCreator by guaranteeing FSFile and FSFolder are the only possible FSEntries
|
||||||
// (as we expect), and it also makes the class abstract as required.
|
// (as we expect), and it also implicitly makes the class abstract as required.
|
||||||
sealed class FSEntry(val name: String)
|
sealed class FSEntry(val name: String)
|
||||||
|
|
||||||
class FSFile(name: String, val content: String) : FSEntry(name)
|
class FSFile(name: String, val content: String) : FSEntry(name)
|
||||||
|
Reference in New Issue
Block a user