Skip to content

Commit

Permalink
Update documentation to use the new way to run scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetbehl committed Aug 24, 2023
1 parent 044d886 commit a0b3ecd
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 38 deletions.
6 changes: 5 additions & 1 deletion gradle/docs.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ if (parts.length >= 3) {
} else if (parts[2].contains('-')) {
final String[] subparts = parts[2].split("-")
patch = subparts.first() as int
stableVersion = "${major}.${minor}.${patch - 1}"
if (patch == 0) {
stableVersion = "${major}.${minor}.${patch}"
} else {
stableVersion = "${major}.${minor}.${patch - 1}"
}
snapshotVersion = "${major}.${minor}." + subparts[1..-1].join("-")
} else {
stableVersion = versionTxt
Expand Down
7 changes: 4 additions & 3 deletions plugin/src/docs/hierarchicalRoles.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ Specifying a static string in the `roleHierarchy` property will be sufficient fo

For example, running

....
$ grails s2-create-role-hierarchy-entry com.yourapp.RoleHierarchyEntry
....
[source,bash]
----
./gradlew runCommand "-Pargs=s2-create-role-hierarchy-entry com.yourapp.RoleHierarchyEntry"
----

will generate this class in `grails-app/domain/com/yourapp/RoleHierarchyEntry.groovy`:

Expand Down
3 changes: 2 additions & 1 deletion plugin/src/docs/installation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ Ensure you have the following set up:
3. Add the Spring Security Core Plugin dependency to the `dependencies` section in your `build.gradle`:

[source,groovy]
[subs="attributes"]
----
dependencies {
// ... other dependencies
implementation 'org.grails.plugins:spring-security-core:${stableVersion}'
implementation 'org.grails.plugins:spring-security-core:{stableversion}'
}
----

Expand Down
14 changes: 8 additions & 6 deletions plugin/src/docs/scripts/s2-create-persistent-token.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@

Creates a persistent token domain class for storing remember-me cookie information in the database. The general format is:

....
grails s2-create-persistent-token <classname>
....
[source,bash]
----
./gradlew runCommand "-Pargs=s2-create-persistent-token <classname>"
----

.Example

....
grails s2-create-persistent-token com.yourapp.PersistentLogin
....
[source,bash]
----
./gradlew runCommand "-Pargs=s2-create-persistent-token com.yourapp.PersistentLogin"
----

.Description

Expand Down
14 changes: 8 additions & 6 deletions plugin/src/docs/scripts/s2-create-role-hierarchy-entry.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@

Creates a persistent role hierarchy entry domain class for storing role hierarchy information in the database. The general format is:

....
grails s2-create-role-hierarchy-entry <classname>
....
[source,bash]
----
./gradlew runCommand "-Pargs=s2-create-role-hierarchy-entry <classname>"
----

.Example

....
grails s2-create-role-hierarchy-entry com.yourapp.RoleHierarchyEntry
....
[source,bash]
----
./gradlew runCommand "-Pargs=s2-create-role-hierarchy-entry com.yourapp.RoleHierarchyEntry"
----

.Description

Expand Down
41 changes: 23 additions & 18 deletions plugin/src/docs/scripts/s2-quickstart.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,32 @@ If you specify the uiOnly flag, no domain classes are created but the plugin set

The general format is:

....
grails s2-quickstart DOMAIN_CLASS_PACKAGE USER_CLASS_NAME ROLE_CLASS_NAME [REQUESTMAP_CLASS_NAME] [--groupClassName=GROUP_CLASS_NAME]
....
[source,bash]
----
./gradlew runCommand "-Pargs=s2-quickstart DOMAIN_CLASS_PACKAGE USER_CLASS_NAME ROLE_CLASS_NAME [REQUESTMAP_CLASS_NAME] [--groupClassName=GROUP_CLASS_NAME]"
----

.Examples

....
grails s2-quickstart com.yourapp User Role
....

....
grails s2-quickstart com.yourapp User Role --groupClassName=RoleGroup
....

....
grails s2-quickstart com.yourapp Person Authority Requestmap
....

....
grails s2-quickstart --uiOnly
....
[source,bash]
----
./gradlew runCommand "-Pargs=s2-quickstart com.yourapp User Role"
----

[source,bash]
----
./gradlew runCommand "-Pargs=s2-quickstart com.yourapp User Role --groupClassName=RoleGroup"
----

[source,bash]
----
./gradlew runCommand "-Pargs=s2-quickstart com.yourapp Person Authority Requestmap"
----

[source,bash]
----
./gradlew runCommand "-Pargs=s2-quickstart --uiOnly"
----

.Description

Expand Down
Binary file removed plugin/src/docs/thenewselectoption.png
Binary file not shown.
7 changes: 4 additions & 3 deletions plugin/src/docs/tutorials/usingControllerAnnotations.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ $ grails compile

==== 3. Create the User and Role domain classes.

....
$ grails s2-quickstart com.mycompany.myapp User Role
....
[source,bash]
----
./gradlew runCommand "-Pargs=s2-quickstart com.mycompany.myapp User Role"
----

You can choose your names for your domain classes and package; these are just examples.

Expand Down

0 comments on commit a0b3ecd

Please sign in to comment.