Skip to content

Commit

Permalink
docs: Use tabs where possible to have better distinction between Mave…
Browse files Browse the repository at this point in the history
…n and Gradle
  • Loading branch information
pieterdeschepper authored and triceo committed Dec 14, 2023
1 parent 2b35c89 commit aaa0ebc
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ source code of the Enterprise Edition https://github.com/TimefoldAI/timefold-sol

In order to switch from Timefold Solver Community Edition to Enterprise Edition,
first reference the Enterprise Edition Maven repository in your project.
If you use Maven, add the following repository to your `pom.xml`:

[tabs]
====
Maven::
+
--
Add the following repository to your `pom.xml`:
[source,xml,options="nowrap"]
----
Expand All @@ -40,8 +46,11 @@ If you use Maven, add the following repository to your `pom.xml`:
...
</project>
----

If you use Gradle, add the following in your `build.gradle`:
--
Gradle::
+
--
Add the following in your `build.gradle`:
[source,groovy,options="nowrap"]
----
Expand All @@ -52,6 +61,8 @@ repositories {
}
}
----
--
====

Having done that the above, replace references to Community Edition artifacts by their Enterprise Edition counterparts
as shown in the table below.
Expand Down
33 changes: 24 additions & 9 deletions docs/src/modules/ROOT/pages/introduction/introduction.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ but we're just not entirely comfortable yet to write their signatures in stone.

The Timefold Solver jars are available in https://central.sonatype.com/namespace/ai.timefold.solver[the central maven repository].

If you use Maven, add a dependency to `timefold-solver-core` in your `pom.xml`:
[tabs]
====
Maven::
+
--
Add a dependency to `timefold-solver-core` in your `pom.xml`:
[source,xml,options="nowrap"]
----
Expand Down Expand Up @@ -225,16 +230,20 @@ when adding other timefold dependencies later on:
</dependencies>
</project>
----

If you use Gradle, add a dependency to `timefold-solver-core` in your `build.gradle`:
--
Gradle::
+
--
Add a dependency to `timefold-solver-core` in your `build.gradle`:
[source,groovy,options="nowrap"]
----
dependencies {
implementation 'ai.timefold.solver:timefold-solver-core:...'
}
----

--
====
See also how to xref:enterprise-edition/enterprise-edition.adoc#switchToEnterpriseEdition[switch To Enterprise Edition].

[#useWithOtherBuildTools]
Expand All @@ -244,23 +253,29 @@ See also how to xref:enterprise-edition/enterprise-edition.adoc#switchToEnterpri
Quickly upgrade your source code to the latest and greatest version of Timefold Solver,
run this command:

Maven:

[tabs]
====
Maven::
+
--
[source,shell,subs=attributes+]
----
$ mvn org.openrewrite.maven:rewrite-maven-plugin:LATEST:run \
-Drewrite.recipeArtifactCoordinates=ai.timefold.solver:timefold-solver-migration:{timefold-solver-version} \
-Drewrite.activeRecipes=ai.timefold.solver.migration.ToLatest
----

Gradle:

--
Gradle::
+
--
[source,shell,subs=attributes+]
----
$ curl https://timefold.ai/product/upgrade/upgrade-timefold.gradle > upgrade-timefold.gradle
$ gradle -Dorg.gradle.jvmargs=-Xmx2G --init-script upgrade-timefold.gradle rewriteRun -DtimefoldSolverVersion={timefold-solver-version}
$ rm upgrade-timefold.gradle
----
--
====

It automatically replaces deprecated methods with better alternatives.
Run your tests and commit the changes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Create a Maven or Gradle build file and add these dependencies:
Maven::
+
--
If you choose Maven, your `pom.xml` file has the following content:
Your `pom.xml` file has the following content:
[source,xml,subs=attributes+]
----
Expand Down Expand Up @@ -167,7 +167,7 @@ If you choose Maven, your `pom.xml` file has the following content:
Gradle::
+
--
In Gradle, your `build.gradle` file has this content:
Your `build.gradle` file has this content:
[source,groovy,subs=attributes+]
----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ $ mvn io.quarkus:quarkus-maven-plugin:{quarkus-version}:create \
$ cd timefold-solver-quickstart
----
If you choose Maven, your `pom.xml` file has the following content:
[tabs]
====
Maven::
+
--
Your `pom.xml` file has the following content:
[source,xml,subs=attributes+]
----
Expand Down Expand Up @@ -168,8 +173,11 @@ If you choose Maven, your `pom.xml` file has the following content:
</build>
</project>
----
On the other hand, in Gradle, your `build.gradle` file has this content:
--
Gradle::
+
--
Your `build.gradle` file has this content:
[source,groovy,subs=attributes+]
----
Expand Down Expand Up @@ -218,6 +226,8 @@ test {
systemProperty "java.util.logging.manager", "org.jboss.logmanager.LogManager"
}
----
--
====
include::../school-timetabling/school-timetabling-model.adoc[leveloffset=+1]
include::../school-timetabling/school-timetabling-constraints.adoc[leveloffset=+1]
Expand Down Expand Up @@ -352,6 +362,11 @@ To test each constraint in isolation, use a `ConstraintVerifier` in unit tests.
It tests each constraint's corner cases in isolation from the other tests,
which lowers maintenance when adding a new constraint with proper test coverage.

[tabs]
====
Maven::
+
--
Add a `timefold-solver-test` dependency in your `pom.xml`:
[source,xml]
----
Expand All @@ -366,13 +381,18 @@ Add a `timefold-solver-test` dependency in your `pom.xml`:
<scope>test</scope>
</dependency>
----

For Gradle, add the subsequent dependencies to your `build.gradle`:
--
Gradle::
+
--
Add the subsequent dependencies to your `build.gradle`:
[source,groovy,subs=attributes+]
----
testImplementation "io.quarkus:quarkus-junit5"
testImplementation "ai.timefold.solver:timefold-solver-test"
----
--
====

Create the `src/test/java/org/acme/schooltimetabling/solver/TimetableConstraintProviderTest.java` class:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ Create a Spring Boot application with the following dependencies:
* Spring Web (`spring-boot-starter-web`)
* Timefold Solver (`timefold-solver-spring-boot-starter`)
If you choose Maven, your `pom.xml` file has the following content:
[tabs]
====
Maven::
+
--
Your `pom.xml` file has the following content:
[source,xml,subs=attributes+]
----
Expand Down Expand Up @@ -126,8 +131,11 @@ If you choose Maven, your `pom.xml` file has the following content:
</build>
</project>
----
On the other hand, in Gradle, your `build.gradle` file has this content:
--
Gradle::
+
--
Your `build.gradle` file has this content:
[source,groovy,subs=attributes+]
----
Expand Down Expand Up @@ -159,6 +167,8 @@ test {
useJUnitPlatform()
}
----
--
====
include::../school-timetabling/school-timetabling-model.adoc[leveloffset=+1]
include::../school-timetabling/school-timetabling-constraints.adoc[leveloffset=+1]
Expand Down Expand Up @@ -312,7 +322,11 @@ To test each constraint in isolation, use a `ConstraintVerifier` in unit tests.
It tests each constraint's corner cases in isolation from the other tests,
which lowers maintenance when adding a new constraint with proper test coverage.


[tabs]
====
Maven::
+
--
Add the folllowing dependencies to your `pom.xml`:
[source,xml]
----
Expand All @@ -327,13 +341,18 @@ Add the folllowing dependencies to your `pom.xml`:
<scope>test</scope>
</dependency>
----

For Gradle, add the subsequent dependencies to your `build.gradle`:
--
Gradle::
+
--
Add the subsequent dependencies to your `build.gradle`:
[source,groovy,subs=attributes+]
----
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("ai.timefold.solver:timefold-solver-test")
----
--
====


Create the `src/test/java/org/acme/schooltimetabling/solver/TimetableConstraintProviderTest.java` class:
Expand Down

0 comments on commit aaa0ebc

Please sign in to comment.