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
b146e76b
Commit
b146e76b
authored
Sep 07, 2014
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.1.x'
parents
9c339740
06ffd9dd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
3 deletions
+85
-3
ProjectCreator.java
.../java/org/springframework/boot/gradle/ProjectCreator.java
+11
-1
SpringLoadedTests.java
...va/org/springframework/boot/gradle/SpringLoadedTests.java
+15
-0
build.gradle
.../src/test/resources/spring-loaded-old-gradle/build.gradle
+26
-0
Application.java
...ing-loaded-old-gradle/src/main/java/test/Application.java
+25
-0
RunPluginFeatures.java
...rg/springframework/boot/gradle/run/RunPluginFeatures.java
+8
-2
No files found.
spring-boot-integration-tests/src/test/java/org/springframework/boot/gradle/ProjectCreator.java
View file @
b146e76b
...
@@ -30,6 +30,16 @@ import org.springframework.util.FileSystemUtils;
...
@@ -30,6 +30,16 @@ import org.springframework.util.FileSystemUtils;
*/
*/
public
class
ProjectCreator
{
public
class
ProjectCreator
{
private
String
gradleVersion
;
public
ProjectCreator
()
{
this
(
"1.12"
);
}
public
ProjectCreator
(
String
gradleVersion
)
{
this
.
gradleVersion
=
gradleVersion
;
}
public
ProjectConnection
createProject
(
String
name
)
throws
IOException
{
public
ProjectConnection
createProject
(
String
name
)
throws
IOException
{
File
projectDirectory
=
new
File
(
"target/"
+
name
);
File
projectDirectory
=
new
File
(
"target/"
+
name
);
projectDirectory
.
mkdirs
();
projectDirectory
.
mkdirs
();
...
@@ -46,7 +56,7 @@ public class ProjectCreator {
...
@@ -46,7 +56,7 @@ public class ProjectCreator {
}
}
GradleConnector
gradleConnector
=
GradleConnector
.
newConnector
();
GradleConnector
gradleConnector
=
GradleConnector
.
newConnector
();
gradleConnector
.
useGradleVersion
(
"1.12"
);
gradleConnector
.
useGradleVersion
(
this
.
gradleVersion
);
((
DefaultGradleConnector
)
gradleConnector
).
embedded
(
true
);
((
DefaultGradleConnector
)
gradleConnector
).
embedded
(
true
);
return
gradleConnector
.
forProjectDirectory
(
projectDirectory
).
connect
();
return
gradleConnector
.
forProjectDirectory
(
projectDirectory
).
connect
();
...
...
spring-boot-integration-tests/src/test/java/org/springframework/boot/gradle/SpringLoadedTests.java
View file @
b146e76b
...
@@ -60,6 +60,21 @@ public class SpringLoadedTests {
...
@@ -60,6 +60,21 @@ public class SpringLoadedTests {
"-javaagent:.*springloaded-"
+
SPRING_LOADED_VERSION
+
".jar"
,
output
);
"-javaagent:.*springloaded-"
+
SPRING_LOADED_VERSION
+
".jar"
,
output
);
}
}
@Test
public
void
springLoadedCanBeUsedWithGradle16
()
throws
IOException
{
ProjectConnection
project
=
new
ProjectCreator
(
"1.6"
)
.
createProject
(
"spring-loaded-old-gradle"
);
project
.
newBuild
()
.
forTasks
(
"bootRun"
)
.
withArguments
(
"-PbootVersion="
+
BOOT_VERSION
,
"-PspringLoadedVersion="
+
SPRING_LOADED_VERSION
,
"--stacktrace"
)
.
run
();
List
<
String
>
output
=
getOutput
();
assertOutputMatches
(
"-javaagent:.*springloaded-"
+
SPRING_LOADED_VERSION
+
".jar"
,
output
);
}
private
List
<
String
>
getOutput
()
throws
IOException
{
private
List
<
String
>
getOutput
()
throws
IOException
{
BufferedReader
reader
=
new
BufferedReader
(
new
FileReader
(
new
File
(
BufferedReader
reader
=
new
BufferedReader
(
new
FileReader
(
new
File
(
"target/spring-loaded-jvm-args/build/output.txt"
)));
"target/spring-loaded-jvm-args/build/output.txt"
)));
...
...
spring-boot-integration-tests/src/test/resources/spring-loaded-old-gradle/build.gradle
0 → 100644
View file @
b146e76b
buildscript
{
repositories
{
mavenLocal
()
mavenCentral
()
}
dependencies
{
classpath
(
"org.springframework.boot:spring-boot-gradle-plugin:${project.bootVersion}"
)
classpath
(
"org.springframework:springloaded:${project.springLoadedVersion}"
)
}
}
apply
plugin:
'java'
apply
plugin:
'spring-boot'
repositories
{
mavenLocal
()
mavenCentral
()
}
dependencies
{
compile
(
"org.springframework.boot:spring-boot-starter"
)
}
jar
{
baseName
=
'spring-loaded-old-gradle'
}
\ No newline at end of file
spring-boot-integration-tests/src/test/resources/spring-loaded-old-gradle/src/main/java/test/Application.java
0 → 100644
View file @
b146e76b
package
test
;
import
java.io.File
;
import
java.io.FileWriter
;
import
java.io.PrintWriter
;
import
java.lang.management.ManagementFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.util.Assert
;
public
class
Application
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
PrintWriter
writer
=
new
PrintWriter
(
new
FileWriter
(
new
File
(
"build/output.txt"
)));
for
(
String
argument:
ManagementFactory
.
getRuntimeMXBean
().
getInputArguments
())
{
writer
.
println
(
argument
);
}
writer
.
close
();
}
}
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/RunPluginFeatures.java
View file @
b146e76b
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
package
org
.
springframework
.
boot
.
gradle
.
run
;
package
org
.
springframework
.
boot
.
gradle
.
run
;
import
java.util.Collections
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.Callable
;
import
org.gradle.api.Action
;
import
org.gradle.api.Action
;
...
@@ -74,9 +75,14 @@ public class RunPluginFeatures implements PluginFeatures {
...
@@ -74,9 +75,14 @@ public class RunPluginFeatures implements PluginFeatures {
run
.
getConventionMapping
().
map
(
"jvmArgs"
,
new
Callable
<
Object
>()
{
run
.
getConventionMapping
().
map
(
"jvmArgs"
,
new
Callable
<
Object
>()
{
@Override
@Override
public
Object
call
()
throws
Exception
{
public
Object
call
()
throws
Exception
{
return
project
.
property
(
"applicationDefaultJvmArgs"
);
if
(
project
.
hasProperty
(
"applicationDefaultJvmArgs"
))
{
return
project
.
property
(
"applicationDefaultJvmArgs"
);
}
else
{
return
Collections
.
emptyList
();
}
}
}
});
});
}
}
}
}
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