40 lines
1.7 KiB
Markdown
40 lines
1.7 KiB
Markdown
# 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
|
|
```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
|
|
|
|
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. |