Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
120a39a6
Commit
120a39a6
authored
Feb 29, 2016
by
Dave Syer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.3.x'
parents
d13b9a98
baf7dda0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
15 deletions
+17
-15
AnnotatedNodeASTTransformation.java
...ork/boot/cli/compiler/AnnotatedNodeASTTransformation.java
+16
-14
GenericBomAstTransformation.java
...mework/boot/cli/compiler/GenericBomAstTransformation.java
+1
-1
No files found.
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/AnnotatedNodeASTTransformation.java
View file @
120a39a6
...
...
@@ -45,8 +45,6 @@ public abstract class AnnotatedNodeASTTransformation implements ASTTransformatio
private
final
boolean
removeAnnotations
;
private
List
<
AnnotationNode
>
annotationNodes
=
new
ArrayList
<
AnnotationNode
>();
private
SourceUnit
sourceUnit
;
protected
AnnotatedNodeASTTransformation
(
Set
<
String
>
interestingAnnotationNames
,
...
...
@@ -58,37 +56,38 @@ public abstract class AnnotatedNodeASTTransformation implements ASTTransformatio
@Override
public
void
visit
(
ASTNode
[]
nodes
,
SourceUnit
source
)
{
this
.
sourceUnit
=
source
;
List
<
AnnotationNode
>
annotationNodes
=
new
ArrayList
<
AnnotationNode
>();
ClassVisitor
classVisitor
=
new
ClassVisitor
(
source
);
ClassVisitor
classVisitor
=
new
ClassVisitor
(
source
,
annotationNodes
);
for
(
ASTNode
node
:
nodes
)
{
if
(
node
instanceof
ModuleNode
)
{
ModuleNode
module
=
(
ModuleNode
)
node
;
visitAnnotatedNode
(
module
.
getPackage
());
visitAnnotatedNode
(
module
.
getPackage
()
,
annotationNodes
);
for
(
ImportNode
importNode
:
module
.
getImports
())
{
visitAnnotatedNode
(
importNode
);
visitAnnotatedNode
(
importNode
,
annotationNodes
);
}
for
(
ImportNode
importNode
:
module
.
getStarImports
())
{
visitAnnotatedNode
(
importNode
);
visitAnnotatedNode
(
importNode
,
annotationNodes
);
}
for
(
Map
.
Entry
<
String
,
ImportNode
>
entry
:
module
.
getStaticImports
()
.
entrySet
())
{
visitAnnotatedNode
(
entry
.
getValue
());
visitAnnotatedNode
(
entry
.
getValue
()
,
annotationNodes
);
}
for
(
Map
.
Entry
<
String
,
ImportNode
>
entry
:
module
.
getStaticStarImports
()
.
entrySet
())
{
visitAnnotatedNode
(
entry
.
getValue
());
visitAnnotatedNode
(
entry
.
getValue
()
,
annotationNodes
);
}
for
(
ClassNode
classNode
:
module
.
getClasses
())
{
visitAnnotatedNode
(
classNode
);
visitAnnotatedNode
(
classNode
,
annotationNodes
);
classNode
.
visitContents
(
classVisitor
);
}
}
}
processAnnotationNodes
(
this
.
annotationNodes
);
processAnnotationNodes
(
annotationNodes
);
}
protected
SourceUnit
getSourceUnit
()
{
...
...
@@ -97,7 +96,8 @@ public abstract class AnnotatedNodeASTTransformation implements ASTTransformatio
protected
abstract
void
processAnnotationNodes
(
List
<
AnnotationNode
>
annotationNodes
);
private
void
visitAnnotatedNode
(
AnnotatedNode
annotatedNode
)
{
private
void
visitAnnotatedNode
(
AnnotatedNode
annotatedNode
,
List
<
AnnotationNode
>
annotatedNodes
)
{
if
(
annotatedNode
!=
null
)
{
Iterator
<
AnnotationNode
>
annotationNodes
=
annotatedNode
.
getAnnotations
()
.
iterator
();
...
...
@@ -105,7 +105,7 @@ public abstract class AnnotatedNodeASTTransformation implements ASTTransformatio
AnnotationNode
annotationNode
=
annotationNodes
.
next
();
if
(
this
.
interestingAnnotationNames
.
contains
(
annotationNode
.
getClassNode
().
getName
()))
{
this
.
annotation
Nodes
.
add
(
annotationNode
);
annotated
Nodes
.
add
(
annotationNode
);
if
(
this
.
removeAnnotations
)
{
annotationNodes
.
remove
();
}
...
...
@@ -117,9 +117,11 @@ public abstract class AnnotatedNodeASTTransformation implements ASTTransformatio
private
class
ClassVisitor
extends
ClassCodeVisitorSupport
{
private
final
SourceUnit
source
;
private
List
<
AnnotationNode
>
annotationNodes
;
ClassVisitor
(
SourceUnit
source
)
{
ClassVisitor
(
SourceUnit
source
,
List
<
AnnotationNode
>
annotationNodes
)
{
this
.
source
=
source
;
this
.
annotationNodes
=
annotationNodes
;
}
@Override
...
...
@@ -129,7 +131,7 @@ public abstract class AnnotatedNodeASTTransformation implements ASTTransformatio
@Override
public
void
visitAnnotations
(
AnnotatedNode
node
)
{
visitAnnotatedNode
(
node
);
visitAnnotatedNode
(
node
,
this
.
annotationNodes
);
}
}
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GenericBomAstTransformation.java
View file @
120a39a6
...
...
@@ -40,7 +40,7 @@ import org.springframework.core.Ordered;
/**
* A base class that lets plugin authors easily add additional BOMs to all apps. All the
* dependencies in the BOM (and it
'
s transitives) will be added to the dependency
* dependencies in the BOM (and its transitives) will be added to the dependency
* management lookup, so an app can use just the artifact id (e.g. "spring-jdbc") in a
* {@code @Grab}. To install, implement the missing methods and list the class in
* {@code META-INF/services/org.springframework.boot.cli.compiler.SpringBootAstTransformation}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment