Building kotlin files.

IntelliJ import instructions.
This commit is contained in:
Paul Holt
2022-01-11 00:00:22 +11:00
parent 11ff691efc
commit 5d00a092af
2 changed files with 49 additions and 8 deletions

View File

@@ -20,6 +20,34 @@ Then, run a game
You will need to install openjdk 17, because some games use advanced Java features.
We should be using version 17 anyway, because anything less than 17 is deprecated.
---
## Using an IDE to work on JVM games
You can open the entire Basic Computer Games project in an IDE, with any IDE capable
of importing from a gradle project.
### IntelliJ / Android Studio
1. (Optional) If you want to make changes, or contribute a new kotlin or java version
of one of the games, use [github "fork"](https://docs.github.com/en/get-started/quickstart/fork-a-repo)
to create your own editable fork of the project.
2. Check out the code using `File` -> `New` -> `Project from Version Control`
1. Enter the URL of the project. For the main project this will be `https://github.com/coding-horror/basic-computer-games.git`, for your
own fork this will be `https://github.com/YOURNAMEHERE/basic-computer-games.git`
2. Choose a directory for the clone to live in
3. Click `Clone`
The project will open, and eventually you will get a little alert box in the bottom right corner saying "Gradle build script found".
Click the "Load" link in the alert box, to load the gradle project.
You should see all the games appear on the left side of the screen. If you have loaded
your own fork, you can modify, commit and push your changes to github.
If you are using the main `coding-horror` branch, you can still make and run your own changes. If
your git skills are up to the task, you might even fork the project and change your
local clone to point to your new forked project.
---
## Adding a new game
@@ -37,6 +65,7 @@ The `build.gradle` file will normally be identical to this:
plugins {
id 'application'
// id 'org.jetbrains.kotlin.jvm' // UNCOMMENT for kotlin projects
}
sourceSets {