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".
This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Gleb Koval 8426dff044
Test Workflow / Lint and test library (push) Successful in 1m34s Details
Publish Workflow / Publish library (push) Successful in 2m7s Details
Improve tests & validate FSEntry names (#4)
Contributes to #2 .

- Add some additional tests to existing functionality.
- Cleanup code to use more of `kotlin.io.*` instead of `java.nio.*`.
- Validate FSEntry names on object construction (and tests).
- Validate folders do not contain entries with duplicate names on `FSCreator.create()` (and tests).

Reviewed-on: #4
2024-01-07 16:09:23 +00:00
.github/workflows Fix publish CI 2023-12-20 17:01:16 +00:00
.idea Initial implementations 2023-12-20 13:16:56 +00:00
gradle/wrapper Initial commit 2023-12-03 01:24:30 +00:00
src Improve tests & validate FSEntry names (#4) 2024-01-07 16:09:23 +00:00
.editorconfig Steup CI (#1) 2023-12-20 15:34:40 +00:00
.gitignore Initial implementations 2023-12-20 13:16:56 +00:00
README.md README update 2023-12-20 15:57:35 +00:00
build.gradle.kts Steup CI (#1) 2023-12-20 15:34:40 +00:00
gradle.properties Initial commit 2023-12-03 01:24:30 +00:00
gradlew Initial commit 2023-12-03 01:24:30 +00:00
gradlew.bat Initial commit 2023-12-03 01:24:30 +00:00
settings.gradle.kts Initial commit 2023-12-03 01:24:30 +00:00

README.md

TeamCity Kotlin Script build step extension library - Test Task

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".

The package is (very creatively) named filesystem.

Usage

Gradle

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 from the latest release.

Instructions

Create a library implementing four classes:

  • FSEntry, an abstract class with a name property of the type String;
  • FSFile extending FSEntry and adding a content property of the type String, which will contain a textual file content;
  • FSFolder extending FSEntry and adding a content property of the type List<FSEntry> listing files and folders stored within;
  • FSCreator implementing a single create(entryToCreate: FSEntry, destination: String) method that would create a directory hierarchy described by entryToCreate in a given file system destination path.

Please consider various corner cases and error handling. Unit tests covering various scenarios are expected. The test task could be implemented in either Kotlin or Java.