Skip to content

Creating a project

alexstaeding edited this page Mar 2, 2020 · 7 revisions

This guide will follow the development of a project called SimplePvp and can be read as a follow-along while you are creating your plugin. The goal is to create a plugin that will track kills and deaths for each player.

First Steps

Note: Unless specified, all commands are to be run in your project's root directory.
You can check your current directory with "pwd" on unix based machines or "cd" on windows.

To start working with Anvil, create a new Gradle project in your IDE of choice (we recommend IntelliJ IDEA).

  1. File > New > Project
  2. Select Gradle
  3. Use Java 1.8 as project SDK
  4. Make sure Kotlin DSL build script is disabled
  5. Make sure only java is selected under Additional Libraries and Frameworks
  6. Click next
  7. Pick an ArtifactId and GroupId for your project (name is usually the same as ArtifactId
  8. Click finish

Updating Gradle

Note: If you are on windows, use "gradlew" instead of "./gradlew" for the rest of the guide.

You should now be looking at an empty project. The first thing we will do is update Gradle to the latest version by running the following commands in the terminal.

Note: Gradle 6.2.1 is the latest version at the time of this writing.
If there is a later one available, use that instead.
  1. ./gradlew wrapper --gradle-version 6.2.1
  2. ./gradlew wrapper
Note: If you see the message "You can configure Gradle wrapper to use distribution with sources. It will provide..." above the `build.gradle` file in Intellij,
go to Preferences > Build, Execution, Deployment > Build Tools > Gradle and
set "Use Gradle from" to "'wrapper' task in Gradle build script". Click Apply and Ok to save your changes.

Please head on over to Multiplatform design to continue.