diff --git a/README.md b/README.md index e207f9b..e1ae34a 100644 --- a/README.md +++ b/README.md @@ -7,21 +7,20 @@ See [Getting started](https://doma.readthedocs.io/en/latest/getting-started/). [![Java CI with Gradle](https://github.com/domaframework/getting-started/workflows/Java%20CI%20with%20Gradle/badge.svg)](https://github.com/domaframework/getting-started/actions?query=workflow%3A%22Java+CI+with+Gradle%22) -Notice ------- + Import into your IDE +--------------------- -For Eclipse users, to import this project into Eclipse, adhere to the instructions outlined below. +Import this project into your IDE as a Gradle Project. +This project has been confirmed to work on the following IDEs. -**1. Run the Gradle command:** +- Eclipse 2023-09 (4.29.0) +- IntelliJ IDEA 2023.3.4 (Community Edition) -```sh -$ ./gradlew cleanEclipse eclipse -``` - -**2. Navigate through the Eclipse menu and select:** +Build +----- -``` -File > Import > General > Existing Projects into Workspace -``` +You can build this project with Gradle. -It is important not to choose `File > Import > Gradle > Existing Gradle Project`. \ No newline at end of file +```sh +$ ./gradlew build +``` \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index b292ad1..04ebddb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,5 @@ +import com.diffplug.gradle.eclipse.apt.Factorypath + plugins { java id("com.diffplug.eclipse.apt") version "3.44.0" @@ -30,18 +32,6 @@ subprojects { named("build") { dependsOn("spotlessApply") } - - named("eclipse") { - doFirst { - val prefs = file(".settings/org.eclipse.buildship.core.prefs") - if(!prefs.exists()){ - prefs.appendText(""" - connection.project.dir= - eclipse.preferences.version=1 - """.trimIndent()) - } - } - } } dependencies { @@ -60,23 +50,21 @@ subprojects { file { whenMerged { val classpath = this as org.gradle.plugins.ide.eclipse.model.Classpath - classpath.entries.removeAll { - when (it) { - is org.gradle.plugins.ide.eclipse.model.Output -> it.path == ".apt_generated" - else -> false - } + val folder = org.gradle.plugins.ide.eclipse.model.SourceFolder(".apt_generated", "bin/main") + classpath.entries.add(folder) + val dir = file(folder.path) + if (!dir.exists()) { + dir.mkdir() } } - withXml { - val node = asNode() - node.appendNode("classpathentry", mapOf("kind" to "src", "output" to "bin/main", "path" to ".apt_generated")) - } } } project { buildCommand("org.eclipse.buildship.core.gradleprojectbuilder") natures("org.eclipse.buildship.core.gradleprojectnature") } + // Reset all Eclipse settings when "Refresh Gradle Project" is executed + synchronizationTasks("cleanEclipse", "eclipse") } spotless {