Skip to content

Commit

Permalink
Breakdown readme into reusable imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McNees committed May 21, 2024
1 parent ce27ef4 commit ea6c6ae
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 13 deletions.
33 changes: 20 additions & 13 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
:build_name: gs-scheduling-tasks
:build_version: 0.0.1-SNAPSHOT
:build_system: gradle
:java_version: 17
:spring_academy_available: n
:spring_academy_url:

This guide walks you through the steps for scheduling tasks with Spring.

Expand All @@ -14,20 +17,23 @@ This guide walks you through the steps for scheduling tasks with Spring.
You will build an application that prints out the current time every five seconds by using
Spring Framework's https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/annotation/Scheduled.html[`@Scheduled`^] annotation.

ifndef::env-exclude-spring-initializr[]
== What You Need

* About 15 minutes
* A favorite text editor or IDE
* https://www.oracle.com/java/technologies/downloads/[Java 17^] or later
// rendered if building for Spring Academy
ifdef::env-build-for-spring-academy[]
// required: {project_id}
include::spring_academy_intro.adoc[]
endif::[]

== How to complete this guide
Like most Spring https://spring.io/guides[Getting Started guides^], you can start from scratch and complete each step or you can jump straight to the solution, by viewing the code in https://github.com/spring-guides/gs-scheduling-tasks[this repository^]
// rendered if building for spring.io
ifndef::env-build-for-spring-academy[]

To **see the end result**, do the following:
//rendered if also available on Spring Academy
ifeval::["{spring_academy_available}" == "y"]
// required: {spring_academy_url}
include::spring_academy_see_also.adoc[]
endif::[]

- https://github.com/spring-guides/{project_id}/archive/main.zip[Download^] and unzip the source repository for this guide, or clone it using Git:
`git clone https://github.com/spring-guides/{project_id}.git`
// required: {java_version}, {project_id}
include::guide_intro.adoc[]

[[scratch]]
== Starting with Spring Initializr
Expand All @@ -44,8 +50,8 @@ This service pulls in all the dependencies you need for an application and does

NOTE: If your IDE has the Spring Initializr integration, you can complete this process from your IDE.

NOTE: You can also fork the project from Github and open it in your IDE or other editor. Creating a fork will allow you request changes to this guide through submission of a pull request.
endif::[]
// end render if building for spring.io

== Enable Scheduling

Expand Down Expand Up @@ -144,9 +150,10 @@ public class ScheduledTasksTest {

This test will automatically be executed when running the task `./gradlew clean build`.

// required: {build_system} maven|gradle, {build_name}, {build_version}
// optional: {network_container}, {custom_hint_include_file}
include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/main/build_and_execute_guide.adoc[]


== Summary

Congratulations! You created an application with a scheduled task.
Expand Down
15 changes: 15 additions & 0 deletions guide_intro.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
== What You Need

* About 15 minutes
* A favorite text editor or IDE
* https://www.oracle.com/java/technologies/downloads/[Java {java_version}^] or later
== How to complete this guide
Like most Spring https://spring.io/guides[Getting Started guides^], you can start from scratch and complete each step, or you can jump straight to the solution, by viewing the code in https://github.com/spring-guides/{project_id}[this repository^].

To **see the end result in your local environment**, you can do one of the following:

- https://github.com/spring-guides/{project_id}/archive/main.zip[Download^] and unzip the source repository for this guide
- Clone the repository using Git:
`git clone https://github.com/spring-guides/{project_id}.git`
- Fork the repository which will allow you to request changes to this guide through submission of a pull request
2 changes: 2 additions & 0 deletions spring_academy_intro.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The source code for this guide can be found in https://github.com/spring-guides/{project_id}[this repository^].
If you would like a local copy of the code you can download it there.
7 changes: 7 additions & 0 deletions spring_academy_see_also.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
== Spring Academy

This guide is also available on {spring_academy_url}[Spring Academy^] so you can start writing code in a matter of minutes.
Launching this guide in Spring Academy will load an IDE (VScode) in your browser.
You can follow along with the guide, write code, and run your application all without making any changes to your local machine.

If you choose not to use Spring Academy, continue to follow the guide below to use your local machine for development.

0 comments on commit ea6c6ae

Please sign in to comment.