mirror of
https://github.com/chylex/Advent-of-Code.git
synced 2025-06-02 06:34:05 +02:00
Restructure project configuration (2021)
This commit is contained in:
parent
59db6f9c82
commit
9e3e084c76
.gitignore
.idea/runConfigurations
2021
.gitignore
README.mdsettings.gradle.kts.idea/runConfigurations
build.gradle.ktsgradle.propertiesgradle/wrapper
gradlewgradlew.batsettings.gradle.kts
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,6 +1,3 @@
|
|||||||
/.gradle/
|
|
||||||
/build/
|
|
||||||
|
|
||||||
/.idea/compiler.xml
|
/.idea/compiler.xml
|
||||||
/.idea/dictionaries
|
/.idea/dictionaries
|
||||||
/.idea/encodings.xml
|
/.idea/encodings.xml
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="2021 - Day 01" type="JetRunConfigurationType">
|
|
||||||
<option name="MAIN_CLASS_NAME" value="MainKt" />
|
|
||||||
<module name="Advent_of_Code.2021-01" />
|
|
||||||
<shortenClasspath name="NONE" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/2021/01" />
|
|
||||||
<method v="2">
|
|
||||||
<option name="Make" enabled="true" />
|
|
||||||
</method>
|
|
||||||
</configuration>
|
|
||||||
</component>
|
|
@ -1,11 +0,0 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="2021 - Day 02" type="JetRunConfigurationType">
|
|
||||||
<option name="MAIN_CLASS_NAME" value="MainKt" />
|
|
||||||
<module name="Advent_of_Code.2021-02" />
|
|
||||||
<shortenClasspath name="NONE" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/2021/02" />
|
|
||||||
<method v="2">
|
|
||||||
<option name="Make" enabled="true" />
|
|
||||||
</method>
|
|
||||||
</configuration>
|
|
||||||
</component>
|
|
@ -1,11 +0,0 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="2021 - Day 03" type="JetRunConfigurationType">
|
|
||||||
<option name="MAIN_CLASS_NAME" value="MainKt" />
|
|
||||||
<module name="Advent_of_Code.2021-03" />
|
|
||||||
<shortenClasspath name="NONE" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/2021/03" />
|
|
||||||
<method v="2">
|
|
||||||
<option name="Make" enabled="true" />
|
|
||||||
</method>
|
|
||||||
</configuration>
|
|
||||||
</component>
|
|
@ -1,11 +0,0 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="2021 - Day 04" type="JetRunConfigurationType">
|
|
||||||
<option name="MAIN_CLASS_NAME" value="MainKt" />
|
|
||||||
<module name="Advent_of_Code.2021-04" />
|
|
||||||
<shortenClasspath name="NONE" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/2021/04" />
|
|
||||||
<method v="2">
|
|
||||||
<option name="Make" enabled="true" />
|
|
||||||
</method>
|
|
||||||
</configuration>
|
|
||||||
</component>
|
|
5
2021/.gitignore
vendored
Normal file
5
2021/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
/.idea/*
|
||||||
|
!/.idea/runConfigurations
|
||||||
|
|
||||||
|
/.gradle/
|
||||||
|
/build/
|
23
2021/.idea/runConfigurations/Day_01.xml
Normal file
23
2021/.idea/runConfigurations/Day_01.xml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Day 01" type="GradleRunConfiguration" factoryName="Gradle">
|
||||||
|
<ExternalSystemSettings>
|
||||||
|
<option name="executionName" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="externalSystemIdString" value="GRADLE" />
|
||||||
|
<option name="scriptParameters" value="--quiet" />
|
||||||
|
<option name="taskDescriptions">
|
||||||
|
<list />
|
||||||
|
</option>
|
||||||
|
<option name="taskNames">
|
||||||
|
<list>
|
||||||
|
<option value="01" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
<option name="vmOptions" />
|
||||||
|
</ExternalSystemSettings>
|
||||||
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
23
2021/.idea/runConfigurations/Day_02.xml
Normal file
23
2021/.idea/runConfigurations/Day_02.xml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Day 02" type="GradleRunConfiguration" factoryName="Gradle">
|
||||||
|
<ExternalSystemSettings>
|
||||||
|
<option name="executionName" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="externalSystemIdString" value="GRADLE" />
|
||||||
|
<option name="scriptParameters" value="--quiet" />
|
||||||
|
<option name="taskDescriptions">
|
||||||
|
<list />
|
||||||
|
</option>
|
||||||
|
<option name="taskNames">
|
||||||
|
<list>
|
||||||
|
<option value="02" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
<option name="vmOptions" />
|
||||||
|
</ExternalSystemSettings>
|
||||||
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
23
2021/.idea/runConfigurations/Day_03.xml
Normal file
23
2021/.idea/runConfigurations/Day_03.xml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Day 03" type="GradleRunConfiguration" factoryName="Gradle">
|
||||||
|
<ExternalSystemSettings>
|
||||||
|
<option name="executionName" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="externalSystemIdString" value="GRADLE" />
|
||||||
|
<option name="scriptParameters" value="--quiet" />
|
||||||
|
<option name="taskDescriptions">
|
||||||
|
<list />
|
||||||
|
</option>
|
||||||
|
<option name="taskNames">
|
||||||
|
<list>
|
||||||
|
<option value="03" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
<option name="vmOptions" />
|
||||||
|
</ExternalSystemSettings>
|
||||||
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
23
2021/.idea/runConfigurations/Day_04.xml
Normal file
23
2021/.idea/runConfigurations/Day_04.xml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Day 04" type="GradleRunConfiguration" factoryName="Gradle">
|
||||||
|
<ExternalSystemSettings>
|
||||||
|
<option name="executionName" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="externalSystemIdString" value="GRADLE" />
|
||||||
|
<option name="scriptParameters" value="--quiet" />
|
||||||
|
<option name="taskDescriptions">
|
||||||
|
<list />
|
||||||
|
</option>
|
||||||
|
<option name="taskNames">
|
||||||
|
<list>
|
||||||
|
<option value="04" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
<option name="vmOptions" />
|
||||||
|
</ExternalSystemSettings>
|
||||||
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
23
2021/.idea/runConfigurations/Day_05.xml
Normal file
23
2021/.idea/runConfigurations/Day_05.xml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Day 05" type="GradleRunConfiguration" factoryName="Gradle">
|
||||||
|
<ExternalSystemSettings>
|
||||||
|
<option name="executionName" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="externalSystemIdString" value="GRADLE" />
|
||||||
|
<option name="scriptParameters" value="--quiet" />
|
||||||
|
<option name="taskDescriptions">
|
||||||
|
<list />
|
||||||
|
</option>
|
||||||
|
<option name="taskNames">
|
||||||
|
<list>
|
||||||
|
<option value="05" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
<option name="vmOptions" />
|
||||||
|
</ExternalSystemSettings>
|
||||||
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
23
2021/.idea/runConfigurations/Day_06.xml
Normal file
23
2021/.idea/runConfigurations/Day_06.xml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Day 06" type="GradleRunConfiguration" factoryName="Gradle">
|
||||||
|
<ExternalSystemSettings>
|
||||||
|
<option name="executionName" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="externalSystemIdString" value="GRADLE" />
|
||||||
|
<option name="scriptParameters" value="--quiet" />
|
||||||
|
<option name="taskDescriptions">
|
||||||
|
<list />
|
||||||
|
</option>
|
||||||
|
<option name="taskNames">
|
||||||
|
<list>
|
||||||
|
<option value="06" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
<option name="vmOptions" />
|
||||||
|
</ExternalSystemSettings>
|
||||||
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
23
2021/.idea/runConfigurations/Day_07.xml
Normal file
23
2021/.idea/runConfigurations/Day_07.xml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Day 07" type="GradleRunConfiguration" factoryName="Gradle">
|
||||||
|
<ExternalSystemSettings>
|
||||||
|
<option name="executionName" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="externalSystemIdString" value="GRADLE" />
|
||||||
|
<option name="scriptParameters" value="--quiet" />
|
||||||
|
<option name="taskDescriptions">
|
||||||
|
<list />
|
||||||
|
</option>
|
||||||
|
<option name="taskNames">
|
||||||
|
<list>
|
||||||
|
<option value="07" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
<option name="vmOptions" />
|
||||||
|
</ExternalSystemSettings>
|
||||||
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
23
2021/.idea/runConfigurations/Day_08.xml
Normal file
23
2021/.idea/runConfigurations/Day_08.xml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Day 08" type="GradleRunConfiguration" factoryName="Gradle">
|
||||||
|
<ExternalSystemSettings>
|
||||||
|
<option name="executionName" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="externalSystemIdString" value="GRADLE" />
|
||||||
|
<option name="scriptParameters" value="--quiet" />
|
||||||
|
<option name="taskDescriptions">
|
||||||
|
<list />
|
||||||
|
</option>
|
||||||
|
<option name="taskNames">
|
||||||
|
<list>
|
||||||
|
<option value="08" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
<option name="vmOptions" />
|
||||||
|
</ExternalSystemSettings>
|
||||||
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
@ -1,10 +1,12 @@
|
|||||||
|
@file:Suppress("ConvertLambdaToReference")
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "1.6.0"
|
kotlin("jvm") version "1.6.0"
|
||||||
idea
|
idea
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "com.chylex.adventofcode"
|
group = "com.chylex.adventofcode"
|
||||||
version = "1.0-SNAPSHOT"
|
version = "1.0"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@ -19,16 +21,14 @@ idea {
|
|||||||
file(".gradle"),
|
file(".gradle"),
|
||||||
file("build"),
|
file("build"),
|
||||||
file("gradle"),
|
file("gradle"),
|
||||||
file("2015"),
|
|
||||||
file("2020")
|
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
fun make(year: Int, day: Int) {
|
fun make(day: Int) {
|
||||||
val paddedDay = day.toString().padStart(2, '0')
|
val paddedDay = day.toString().padStart(2, '0')
|
||||||
|
|
||||||
val sourceFolder = file("$year/$paddedDay")
|
val sourceFolder = file(paddedDay)
|
||||||
val resourceFolder = sourceFolder.resolve("input")
|
val resourceFolder = sourceFolder.resolve("input")
|
||||||
|
|
||||||
if (!sourceFolder.exists()) {
|
if (!sourceFolder.exists()) {
|
||||||
@ -38,18 +38,21 @@ sourceSets {
|
|||||||
resourceFolder.resolve("1.txt").writeText("")
|
resourceFolder.resolve("1.txt").writeText("")
|
||||||
}
|
}
|
||||||
|
|
||||||
create("$year-$paddedDay") {
|
create(paddedDay) {
|
||||||
java.setSrcDirs(listOf(sourceFolder))
|
java.setSrcDirs(listOf(sourceFolder))
|
||||||
resources.setSrcDirs(listOf(resourceFolder))
|
resources.setSrcDirs(listOf(resourceFolder))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register<JavaExec>(paddedDay) {
|
||||||
|
group = "run"
|
||||||
|
|
||||||
|
mainClass.set("MainKt")
|
||||||
|
workingDir = sourceFolder
|
||||||
|
classpath = sourceSets[paddedDay].runtimeClasspath
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
make(2021, 1)
|
for (day in 1..8) {
|
||||||
make(2021, 2)
|
make(day)
|
||||||
make(2021, 3)
|
}
|
||||||
make(2021, 4)
|
|
||||||
make(2021, 5)
|
|
||||||
make(2021, 6)
|
|
||||||
make(2021, 7)
|
|
||||||
make(2021, 8)
|
|
||||||
}
|
}
|
0
gradlew → 2021/gradlew
vendored
0
gradlew → 2021/gradlew
vendored
0
gradlew.bat → 2021/gradlew.bat
vendored
0
gradlew.bat → 2021/gradlew.bat
vendored
1
2021/settings.gradle.kts
Normal file
1
2021/settings.gradle.kts
Normal file
@ -0,0 +1 @@
|
|||||||
|
rootProject.name = "2021"
|
@ -8,7 +8,9 @@ I have included Run Configurations for JetBrains IDEs, so if you use the appropr
|
|||||||
|
|
||||||
## \[2021\] Kotlin
|
## \[2021\] Kotlin
|
||||||
|
|
||||||
The repository contains a Gradle project (`build.gradle.kts`) that sets up every day as a module. You should be able to load the Gradle project into [IntelliJ IDEA](https://www.jetbrains.com/idea/).
|
The repository contains a Gradle project (`2021/build.gradle.kts`) that sets up every day as a source root and a task that can be launched with `gradlew <day>`, for ex. `gradlew 01`.
|
||||||
|
|
||||||
|
You should be able to load the Gradle project into [IntelliJ IDEA](https://www.jetbrains.com/idea/).
|
||||||
|
|
||||||
The source code is in `main.kt`. The run configuration executes the `main()` method in this file.
|
The source code is in `main.kt`. The run configuration executes the `main()` method in this file.
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
rootProject.name = "Advent of Code"
|
|
Loading…
Reference in New Issue
Block a user