Skip to content

Commit 5d00a82

Browse files
authored
Merge pull request #27 from scaleoutsoftware/br-dev
Update build/PersistenceProviderType initialization improvements
2 parents 09e2e2a + 75fc691 commit 5d00a82

File tree

3 files changed

+53
-3
lines changed

3 files changed

+53
-3
lines changed

Core/build.gradle

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
}
44

55
group 'com.scaleoutsoftware.digitaltwin'
6-
version '3.2.1'
6+
version '3.2.2'
77

88
sourceCompatibility = JavaVersion.VERSION_12
99

@@ -19,15 +19,32 @@ configurations {
1919
archives
2020
}
2121

22-
task myJavadocs(type: Javadoc) {
22+
task createJavadocs(type: Javadoc) {
2323
source = sourceSets.main.allJava
2424
}
2525

26+
task javadocJar(type: Jar, dependsOn: createJavadocs) {
27+
setArchiveClassifier('javadoc')
28+
from javadoc.destinationDir
29+
}
30+
31+
32+
task sourcesJar(type: Jar, dependsOn: classes) {
33+
setArchiveClassifier('sources')
34+
from sourceSets.main.allSource
35+
}
36+
2637
jar {
2738
manifest {
2839
attributes ('Implementation-Title': project.name,
2940
'Implementation-Version': project.version)
3041
}
3142
}
3243

44+
task copyRuntime(type: GradleBuild) {
45+
tasks = ['javadocJar', 'sourcesJar']
46+
}
47+
48+
build.finalizedBy copyRuntime
49+
3350

Core/src/main/java/com/scaleoutsoftware/digitaltwin/core/PersistenceProviderType.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ public static PersistenceProviderType fromString(String name) {
9292
return DynamoDb;
9393
case "Azure Cosmos DB":
9494
return CosmosDb;
95+
case "Default":
96+
case "default":
97+
return Unconfigured;
9598
default:
9699
return null;
97100
}
@@ -108,6 +111,8 @@ public static PersistenceProviderType fromString(String name) {
108111
*/
109112
public static PersistenceProviderType fromOrdinal(int ordinal) {
110113
switch(ordinal) {
114+
case 0:
115+
return Unconfigured;
111116
case 1:
112117
return AzureDigitalTwinsService;
113118
case 3:

Development/build.gradle

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,38 @@ repositories {
1818
dependencies {
1919
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.20.0'
2020
testImplementation group: 'junit', name: 'junit', version: '4.12'
21-
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
21+
implementation group: 'com.google.code.gson', name: 'gson', version: '2.11.0'
2222
// public build configuration
2323
//implementation group: 'com.scaleoutsoftware.digitaltwin', name: 'core', version: '3.0.9'
2424

2525
// local build configuration
2626
implementation fileTree(dir: '..\\Core\\build\\libs\\', include: '*.jar')
2727
}
28+
29+
task createJavadocs(type: Javadoc) {
30+
source = sourceSets.main.allJava
31+
classpath = sourceSets.main.runtimeClasspath
32+
}
33+
34+
task javadocJar(type: Jar, dependsOn: createJavadocs) {
35+
setArchiveClassifier('javadoc')
36+
from javadoc.destinationDir
37+
}
38+
39+
task sourcesJar(type: Jar, dependsOn: classes) {
40+
setArchiveClassifier('sources')
41+
from sourceSets.main.allSource
42+
}
43+
44+
jar {
45+
manifest {
46+
attributes ('Implementation-Title': project.name,
47+
'Implementation-Version': project.version)
48+
}
49+
}
50+
51+
task copyRuntime(type: GradleBuild) {
52+
tasks = ['javadocJar', 'sourcesJar']
53+
}
54+
55+
build.finalizedBy copyRuntime

0 commit comments

Comments
 (0)