Skip to content

Commit f6e9f2d

Browse files
committed
Add docs
- Use grace-doc to generate documentation - Remove unused assets
1 parent b7ab9d2 commit f6e9f2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1377
-952
lines changed

build.gradle

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ buildscript {
1010
}
1111
dependencies {
1212
classpath "io.github.gradle-nexus:publish-plugin:2.0.0"
13+
classpath "org.graceframework:grace-gradle-plugin:$graceVersion"
1314
classpath "io.spring.gradle:dependency-management-plugin:$dependencyManagementPluginVersion"
1415
}
1516
}
@@ -22,11 +23,13 @@ ext.isReleaseVersion = !projectVersion.endsWith("SNAPSHOT")
2223
version = project.projectVersion
2324
group = "org.graceframework"
2425

26+
apply plugin: "groovy"
2527
apply plugin: "java-library"
2628
apply plugin: "io.github.gradle-nexus.publish-plugin"
2729
apply plugin: "maven-publish"
2830
apply plugin: "signing"
2931
apply plugin: "idea"
32+
apply plugin: 'org.graceframework.grace-doc'
3033

3134
allprojects {
3235
repositories {
@@ -37,16 +40,16 @@ allprojects {
3740
}
3841
}
3942
}
43+
44+
configurations {
45+
documentation
46+
}
4047
}
4148

4249
subprojects {
4350
version = project.projectVersion
4451
group = "org.graceframework"
4552

46-
configurations {
47-
documentation
48-
}
49-
5053
apply plugin: "groovy"
5154
apply plugin: "eclipse"
5255
apply plugin: "idea"
@@ -67,10 +70,6 @@ subprojects {
6770
}
6871
}
6972

70-
configurations {
71-
documentation
72-
}
73-
7473
dependencies {
7574
api "org.apache.groovy:groovy"
7675
testImplementation "org.apache.groovy:groovy-test-junit5"
@@ -86,11 +85,6 @@ subprojects {
8685
runtimeOnly "org.junit.jupiter:junit-jupiter-engine"
8786
implementation("org.spockframework:spock-core") { transitive = false }
8887
}
89-
90-
documentation "org.fusesource.jansi:jansi:2.4.0"
91-
documentation "org.apache.groovy:groovy-dateutil"
92-
documentation 'info.picocli:picocli:4.6.3'
93-
documentation ("com.github.javaparser:javaparser-core:$javaParserCoreVersion")
9488
}
9589

9690
if (project.name == "grace-datastore-gorm-async") {
@@ -140,10 +134,6 @@ subprojects {
140134
options.jFlags "-Xms64M", "-Xmx512M"
141135
}
142136

143-
configure([groovydoc]) {
144-
classpath += configurations.documentation
145-
}
146-
147137
publishing {
148138
publications {
149139
maven(MavenPublication) {
@@ -197,6 +187,51 @@ subprojects {
197187
}
198188
}
199189

190+
dependencies {
191+
documentation "com.github.javaparser:javaparser-core:$javaParserCoreVersion"
192+
documentation "org.apache.groovy:groovy:$groovyVersion"
193+
documentation "org.apache.groovy:groovy-ant:$groovyVersion"
194+
}
195+
196+
def cleanTask = project.tasks.findByName('clean')
197+
if (cleanTask == null) {
198+
task clean(type: Delete) {
199+
delete(buildDir)
200+
}
201+
}
202+
else {
203+
cleanTask.doLast {
204+
ant.delete(dir: 'build/docs')
205+
}
206+
}
207+
208+
tasks.withType(Groovydoc) {
209+
group = 'Documentation'
210+
docTitle = "Grace Data - ${project.version}"
211+
destinationDir = project.file('build/docs/manual/api')
212+
def files = []
213+
project.rootProject.subprojects
214+
.findAll { !it.name != 'docs' && !it.name.startsWith('examples') }
215+
.each { subproject ->
216+
if(subproject.file('src/main/groovy').exists()) {
217+
files += subproject.files('src/main/groovy')
218+
}
219+
if(subproject.file('src/main/java').exists()) {
220+
files += subproject.files('src/main/java')
221+
}
222+
}
223+
if (project.file('src/main/groovy').exists()) {
224+
files += project.files('src/main/groovy')
225+
}
226+
source = files
227+
classpath += configurations.documentation
228+
}
229+
230+
docs {
231+
dependsOn groovydoc
232+
sourceDir = project.file('src/docs')
233+
}
234+
200235
project.afterEvaluate {
201236
allprojects.repositories.each { handler ->
202237
handler.each {

gradle.properties

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
title=Grace Data
2-
projectDesc=Grace Data Access Framework
3-
projectUrl=https://github.com/graceframework/grace-data
41
projectVersion=2023.3.0-SNAPSHOT
5-
githubSlug=graceframework/grace-data
6-
developers=Michael Yan
72
commonsValidatorVersion=1.9.0
83
dependencyManagementPluginVersion=1.1.7
94
elImplVersion=4.0.2

src/docs/guide/gettingStarted.adoc

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
=== Checking out and Building
2+
3+
The project is https://github.com/graceframework/grails-data[hosted on GitHub].
4+
5+
You are free to fork the project from there or clone it anonymously using git:
6+
7+
----
8+
git clone https://github.com/graceframework/grails-data.git
9+
cd grace-data
10+
----
11+
12+
The project has a https://gradle.org[Gradle] build.
13+
14+
To build the project you can run the `assemble` task:
15+
16+
[source, bash]
17+
----
18+
./gradlew assemble
19+
----
20+
21+
To install the jar files for the various subprojects into your local Maven repository you can run:
22+
23+
[source, bash]
24+
----
25+
./gradlew publishToMavenLocal
26+
----
27+
28+
=== Project Structure
29+
30+
The project is essentially a multi-project Gradle build. There is a core API and then subprojects that implement that API. The core API subprojects include:
31+
32+
* `grace-datastore-core` - The core API, this provides core interfaces for implementing a GORM provider
33+
* `grace-datastore-gorm` - The runtime meta-programming and AST transformation infrastructure behind GORM. This also provides end users with APIs like `grails.gorm.CriteriaBuilder` and `grails.gorm.DetachedCriteria`
34+
* `grace-datastore-gorm-support` - Support classes for easing the writing of a GORM plugin for Grails
35+
* `grace-datastore-gorm-tck` - The TCK that includes hundreds of Spock specifications that a GORM implementation will need to pass
36+
* `grace-datastore-web` - Classes required to integrate GORM into a web tier
37+
38+
In addition to this, there are separate projects of GORM implementations for various datastores:
39+
40+
* https://github.com/graceframework/grace-data-hibernate[Grace Data Hibernate]
41+
* https://github.com/graceframework/grace-data-mongodb[Grace Data MongoDB]

src/docs/guide/index.adoc

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
:imagesdir: ./images
2+
:source-highlighter: coderay
3+
:toc: left
4+
:toc-title: GORM Developer Guide
5+
:numbered:
6+
:last-update-label!:
7+
8+
= GORM Developer Guide
9+
Graeme Rocher
10+
11+
[[introduction]]
12+
== Introduction
13+
14+
include::introduction.adoc[]
15+
16+
[[gettingStarted]]
17+
== Getting Started
18+
19+
include::gettingStarted.adoc[]
20+
21+
[[understandingApi]]
22+
== Understanding the GORM API
23+
24+
include::understandingApi.adoc[]
25+
26+
[[datastoreBasics]]
27+
=== Datastore Basics
28+
29+
include::understandingApi/datastoreBasics.adoc[]
30+
31+
[[implementingCrud]]
32+
=== Implementing CRUD
33+
34+
include::understandingApi/implementingCrud.adoc[]
35+
36+
[[secondaryIndexes]]
37+
=== Secondary Indexing
38+
39+
include::understandingApi/secondaryIndexes.adoc[]
40+
41+
[[implementingQueries]]
42+
=== Implementing Querying
43+
44+
include::understandingApi/implementingQueries.adoc[]
45+
46+
[[gormEnhancer]]
47+
=== GORM Enhancer
48+
49+
include::understandingApi/gormEnhancer.adoc[]
50+
51+
[[gormApis]]
52+
=== Adding to GORM APIs
53+
54+
include::understandingApi/gormApis.adoc[]
55+
56+
[[testing]]
57+
== Using the Test Compatibility Kit
58+
59+
include::testing.adoc[]
60+
61+
[[stepByStep]]
62+
== Step-by-Step Guide to Creating an Implementation
63+
64+
include::stepByStep.adoc[]

src/docs/guide/introduction.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
This documentation describes the GORM API mechanics and how a datastore implementation can be built to interface to any database providing a GORM API onto it. This documentation is mainly targeted at developers interested in creating implementations of GORM on top of alternative datastores.
2+
3+
As of this writing the project has several implementations of GORM against a variety of different datastore implementations. Current implementations include:
4+
5+
* Hibernate 5
6+
* MongoDB
7+
* java.util.ConcurrentHashMap (the fastest datastore in the world)
8+
9+
The remainder of this document describes how the project is structured, how to build a project and how to implement a GORM provider.

0 commit comments

Comments
 (0)