Skip to content

Commit 992c5b3

Browse files
committed
fix the serverless & naked-to-objects
1 parent f221ba4 commit 992c5b3

3 files changed

Lines changed: 65 additions & 4 deletions

File tree

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ before_install:
1414

1515
# default install command is just "mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V"
1616
install:
17-
- gradle build -x test
18-
- gradle test -x :serverless:test -x :naked-objects:naked-objects-integtests:test
17+
- gradle build
1918

2019
after_success:
2120
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN

naked-objects/integtests/build.gradle

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
apply plugin: "java"
12

23
description = ''
34
dependencies {
@@ -12,3 +13,58 @@ dependencies {
1213
testCompile group: 'org.assertj', name: 'assertj-core', version:'2.0.0'
1314
testCompile group: 'org.junit.vintage', name: 'junit-vintage-engine', version:'4.12.2'
1415
}
16+
17+
test {
18+
useJUnitPlatform()
19+
exclude 'domainapp/**'
20+
21+
}
22+
23+
24+
sourceSets {
25+
test {
26+
resources {
27+
srcDirs = ["src/test/java", "src/test/resources/"]
28+
// exclude("**/*.java")
29+
}
30+
}
31+
32+
}
33+
34+
35+
task datanucleusEnhance {
36+
description "Enhance JPA model classes using DataNucleus Enhancer"
37+
dependsOn compileJava
38+
39+
doLast {
40+
// define the entity classes
41+
def entityFiles = fileTree(sourceSets.test.output.classesDir).matching {
42+
include 'domainapp/**/*.class'
43+
}
44+
45+
println "Enhancing with DataNucleus the following files"
46+
entityFiles.getFiles().each {
47+
println it
48+
}
49+
50+
// define Ant task for DataNucleus Enhancer
51+
ant.taskdef(
52+
name : 'datanucleusenhancer',
53+
classpath : sourceSets.test.runtimeClasspath.asPath,
54+
classname : 'org.datanucleus.enhancer.EnhancerTask'
55+
// the below is for DataNucleus Enhancer 3.1.1
56+
// classname : 'org.datanucleus.enhancer.tools.EnhancerTask'
57+
)
58+
59+
// run the DataNucleus Enhancer as an Ant task
60+
ant.datanucleusenhancer(
61+
classpath: sourceSets.test.runtimeClasspath.asPath,
62+
verbose: true,
63+
api: "JPA") {
64+
entityFiles.addToAntBuilder(ant, 'fileset', FileCollection.AntType.FileSet)
65+
}
66+
}
67+
}
68+
69+
// test.dependsOn(processResources)
70+
test.dependsOn(datanucleusEnhance)

serverless/build.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11

22
description = ''
3+
apply plugin: 'java'
34
dependencies {
45
compile group: 'com.amazonaws', name: 'aws-lambda-java-core', version:'1.1.0'
56
compile(group: 'com.amazonaws', name: 'aws-java-sdk-dynamodb', version:'1.11.289') {
6-
exclude(module: 'aws-java-sdk-s3')
7-
exclude(module: 'aws-java-sdk-kms')
7+
exclude(module: 'aws-java-sdk-s3')
8+
exclude(module: 'aws-java-sdk-kms')
89
}
910
compile group: 'com.amazonaws', name: 'aws-lambda-java-events', version:'2.0.1'
1011
compile group: 'com.amazonaws', name: 'aws-lambda-java-log4j', version:'1.0.0'
@@ -16,3 +17,8 @@ exclude(module: 'aws-java-sdk-kms')
1617
testCompile group: 'org.mockito', name: 'mockito-core', version:'1.10.19'
1718
testCompile group: 'junit', name: 'junit', version:'4.12'
1819
}
20+
21+
test {
22+
useJUnitPlatform()
23+
}
24+

0 commit comments

Comments
 (0)