You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2017/07/14 19:12:41 UTC
groovy git commit: GROOVY-8257: Incorrect package for Mixin AST
transform in online docs
Repository: groovy
Updated Branches:
refs/heads/master 72a7f35e2 -> ad9e1e529
GROOVY-8257: Incorrect package for Mixin AST transform in online docs
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/ad9e1e52
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/ad9e1e52
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/ad9e1e52
Branch: refs/heads/master
Commit: ad9e1e52973f1ec69c960b45e49c5d8783cb6edf
Parents: 72a7f35
Author: paulk <pa...@asert.com.au>
Authored: Sat Jul 15 05:12:03 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Sat Jul 15 05:12:28 2017 +1000
----------------------------------------------------------------------
.../doc/core-domain-specific-languages.adoc | 1 +
src/spec/doc/core-metaprogramming.adoc | 22 ++++++++++++++++++--
src/spec/doc/core-traits.adoc | 1 +
3 files changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/ad9e1e52/src/spec/doc/core-domain-specific-languages.adoc
----------------------------------------------------------------------
diff --git a/src/spec/doc/core-domain-specific-languages.adoc b/src/spec/doc/core-domain-specific-languages.adoc
index 8b12a3a..001705f 100644
--- a/src/spec/doc/core-domain-specific-languages.adoc
+++ b/src/spec/doc/core-domain-specific-languages.adoc
@@ -196,6 +196,7 @@ include::{projectdir}/src/spec/test/BaseScriptSpecTest.groovy[tags=use_custom_co
<3> then create a `GroovyShell` using that configuration
<4> the script will then extend the base script class, giving direct access to the `name` property and `greet` method
+[[dsl-basescript]]
=== The @BaseScript annotation
As an alternative, it is also possible to use the `@BaseScript` annotation directly into a script:
http://git-wip-us.apache.org/repos/asf/groovy/blob/ad9e1e52/src/spec/doc/core-metaprogramming.adoc
----------------------------------------------------------------------
diff --git a/src/spec/doc/core-metaprogramming.adoc b/src/spec/doc/core-metaprogramming.adoc
index 4609d7f..520376b 100644
--- a/src/spec/doc/core-metaprogramming.adoc
+++ b/src/spec/doc/core-metaprogramming.adoc
@@ -1553,6 +1553,13 @@ include::{projectdir}/src/spec/test/CodeGenerationASTTransformsTest.groovy[tags=
This category of annotations are aimed at simplifying the implementation of well-known design patterns (delegation,
singleton, ...) by using a declarative style.
+[[xform-BaseScript]]
+===== `@groovy.transform.BaseScript`
+
+`@BaseScript` is used within scripts to indicate that the script should
+extend fron a custom script base class rather than `groovy.lang.Script`.
+See the documentation for <<dsl-basescript,domain specific languages>> for further details.
+
[[xform-Delegate]]
===== `@groovy.lang.Delegate`
@@ -1736,6 +1743,11 @@ _protectedCacheSize>0_ would create an unlimited cache with some results protect
create a limited cache but without any protection from garbage protection. Setting both would create a limited,
protected cache.
+[[xform-TailRecursive]]
+===== `@groovy.transform.TailRecursive`
+
+TBD
+
[[xform-Singleton]]
===== `@groovy.lang.Singleton`
@@ -1766,7 +1778,7 @@ include::{projectdir}/src/spec/test/ClassDesignASTTransformsTest.groovy[tags=sin
In this example, we also set the `strict` parameter to false, which allows us to define our own constructor.
[[xform-Mixin]]
-===== `@groovy.transform.Mixin`
+===== `@groovy.lang.Mixin`
Deprecated. Consider using traits instead.
@@ -2372,6 +2384,12 @@ for testing purposes, or when integrating with third-party libraries which requi
using <<xform-TypeChecked,type checking>> or <<xform-CompileStatic, static compilation>>. The annotation is described thoroughly in the
<<section-delegatesto,DSL section>> of this guide.
+[[xform-SelfType]]
+===== `@groovy.transform.SelfType`
+
+`@SelfType` is not an AST transformation but rather a marker interface used
+with traits. See the <<traits-selftype,traits documentation>> for further details.
+
==== Swing patterns
[[xform-Bindable]]
@@ -2460,7 +2478,7 @@ include::{projectdir}/src/spec/test/SwingASTTransformsTest.groovy[tags=vetoable_
==== Test assistance
[[xform-NotYetImplemented]]
-===== `@groovy.lang.NotYetImplemented`
+===== `@groovy.transform.NotYetImplemented`
`@NotYetImplemented` is used to invert the result of a JUnit 3/4 test case. It is in particular useful if a feature is not yet implemented but the test is. In that case, it is expected
that the test fails. Marking it with `@NotYetImplemented` will inverse the result of the test, like in this example:
http://git-wip-us.apache.org/repos/asf/groovy/blob/ad9e1e52/src/spec/doc/core-traits.adoc
----------------------------------------------------------------------
diff --git a/src/spec/doc/core-traits.adoc b/src/spec/doc/core-traits.adoc
index d443b94..37d5382 100644
--- a/src/spec/doc/core-traits.adoc
+++ b/src/spec/doc/core-traits.adoc
@@ -786,6 +786,7 @@ include::{projectdir}/src/spec/test/TraitsSpecificationTest.groovy[tags=selftype
If you want to be able to call this in the trait, then you will explicitly need to cast `this` into a `Device`. This can
quickly become unreadable with explicit casts to this everywhere.
+[[traits-selftype]]
=== The @SelfType annotation
In order to make this contract explicit, and to make the type checker aware of the _type of itself_, Groovy provides