-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
Signed-off-by: Kengo TODA <skypencil@gmail.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# https://help.github.com/articles/dealing-with-line-endings/ | ||
# | ||
# Linux start script should use lf | ||
/gradlew text eol=lf | ||
|
||
# These are Windows script files and should use crlf | ||
*.bat text eol=crlf | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Continuous Integration | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: {} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version-file: .java-version | ||
- name: Build with Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: build --scan |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Ignore Gradle project-specific cache directory | ||
.gradle | ||
|
||
# Ignore Gradle build output directory | ||
build |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
21 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
plugins { | ||
id("jp.skypencil.kosmo.kotlin-application-conventions") | ||
} | ||
|
||
application { | ||
mainClass.set("jp.skypencil.kosmo.backend.AppKt") | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package jp.skypencil.kosmo.backend | ||
|
||
class Coordinator { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10") | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
* | ||
* This settings file is used to specify which projects to include in your build-logic build. | ||
*/ | ||
|
||
rootProject.name = "buildSrc" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
plugins { | ||
id("jp.skypencil.kosmo.kotlin-common-conventions") | ||
|
||
application | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
plugins { | ||
id("org.jetbrains.kotlin.jvm") | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
java { | ||
toolchain { | ||
languageVersion.set(JavaLanguageVersion.of(17)) | ||
} | ||
} | ||
|
||
tasks.named<Test>("test") { | ||
useJUnitPlatform() | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
plugins { | ||
id("jp.skypencil.kosmo.kotlin-common-conventions") | ||
`java-library` | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
plugins { | ||
id("jp.skypencil.kosmo.kotlin-application-conventions") | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
* This Kotlin source file was generated by the Gradle 'init' task. | ||
*/ | ||
package jp.skypencil.kosmo.list | ||
|
||
class LinkedList { | ||
private var head: Node? = null | ||
|
||
fun add(element: String) { | ||
val newNode = Node(element) | ||
|
||
val it = tail(head) | ||
if (it == null) { | ||
head = newNode | ||
} else { | ||
it.next = newNode | ||
} | ||
} | ||
|
||
private fun tail(head: Node?): Node? { | ||
var it: Node? | ||
|
||
it = head | ||
while (it?.next != null) { | ||
it = it.next | ||
} | ||
|
||
return it | ||
} | ||
|
||
fun remove(element: String): Boolean { | ||
var result = false | ||
var previousIt: Node? = null | ||
var it: Node? = head | ||
while (!result && it != null) { | ||
if (0 == element.compareTo(it.data)) { | ||
result = true | ||
unlink(previousIt, it) | ||
break | ||
} | ||
previousIt = it | ||
it = it.next | ||
} | ||
|
||
return result | ||
} | ||
|
||
private fun unlink(previousIt: Node?, currentIt: Node) { | ||
if (currentIt == head) { | ||
head = currentIt.next | ||
} else { | ||
previousIt?.next = currentIt.next | ||
} | ||
} | ||
|
||
fun size(): Int { | ||
var size = 0 | ||
|
||
var it = head | ||
while (it != null) { | ||
++size | ||
it = it.next | ||
} | ||
|
||
return size | ||
} | ||
|
||
fun get(idx: Int): String { | ||
var index = idx | ||
var it = head | ||
while (index > 0 && it != null) { | ||
it = it.next | ||
index-- | ||
} | ||
|
||
if (it == null) { | ||
throw IndexOutOfBoundsException("Index is out of range") | ||
} | ||
|
||
return it.data | ||
} | ||
|
||
private data class Node(val data: String) { | ||
var next: Node? = null | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |