Skip to content

Commit

Permalink
Merge pull request #8 from dcm4che/dev
Browse files Browse the repository at this point in the history
Fix that .build() did expose the private SimpleBuilder instead of the Holder interface
  • Loading branch information
Nirostar committed May 2, 2023
2 parents d4ba898 + f44ee61 commit 375c652
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/gradleBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:
name: Standard Library
path: dcm4che-typeddicom-lib/dcm4che-typeddicom-lib-std/build/libs
retention-days: 7
- uses: actions/upload-artifact@v3
with:
name: Generator Library
path: dcm4che-typeddicom-generator/dcm4che-typeddicom-java-generator-gradleplugin/build/libs
retention-days: 7
- uses: actions/upload-artifact@v3
with:
name: Generator Gradle Plugin
Expand Down
10 changes: 5 additions & 5 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repositories {

```groovy
dependencies {
implementation 'org.dcm4che:dcm4che-typeddicom-lib-std:0.5.2'
implementation 'org.dcm4che:dcm4che-typeddicom-lib-std:0.5.3'
}
```

Expand All @@ -41,7 +41,7 @@ repositories {

```kotlin
dependencies {
implementation("org.dcm4che:dcm4che-typeddicom-lib-std:0.5.2")
implementation("org.dcm4che:dcm4che-typeddicom-lib-std:0.5.3")
}
```

Expand All @@ -60,7 +60,7 @@ dependencies {
<dependency>
<groupId>org.dcm4che</groupId>
<artifactId>dcm4che-typeddicom</artifactId>
<version>0.5.2</version>
<version>0.5.3</version>
</dependency>
```
### Use private tags with the gradle plugin
Expand All @@ -78,7 +78,7 @@ buildscript {
plugins {
id 'java-library'
id 'org.dcm4che.typeddicom-java-generator' version '0.5.2'
id 'org.dcm4che.typeddicom-java-generator' version '0.5.3'
}
generateTypeddicomJavaSources {
Expand All @@ -99,7 +99,7 @@ buildscript {

plugins {
id("java-library")
id("org.dcm4che.typeddicom-java-generator") version "0.5.2"
id("org.dcm4che.typeddicom-java-generator") version "0.5.3"
}

generateTypeddicomJavaSources {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public class {{keyword}} extends {{#sequence}}SequenceWrapper<{{keyword}}, {{key
getAttributes().remove(PRIVATE_CREATOR, TAG);
}

class Builder extends AbstractAttributesWrapper implements org.dcm4che.typeddicom.Builder<Builder, SimpleHolder>, {{keyword}}.Builder<Builder, SimpleHolder> {
class Builder extends AbstractAttributesWrapper implements org.dcm4che.typeddicom.Builder<Builder, Holder>, {{keyword}}.Builder<Builder, Holder> {
private Builder() {
super();
}
Expand All @@ -248,7 +248,7 @@ public class {{keyword}} extends {{#sequence}}SequenceWrapper<{{keyword}}, {{key
}

@Override
public SimpleHolder build() {
public Holder build() {
return super.copy(SimpleHolder.class);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import org.dcm4che.typeddicom.AttributesWrapper;
import org.dcm4che.typeddicom.UniversalAttributesWrapper;
import org.dcm4che.typeddicom.dataelements.DisplayedAreaSelectionSequence;
import org.dcm4che.typeddicom.dataelements.PixelAspectRatio;
import org.dcm4che.typeddicom.dataelements.ReferencedImageSequence;
import org.dcm4che.typeddicom.dataelements.ReferencedSeriesSequence;
import org.dcm4che.typeddicom.iods.CRImageIOD;
Expand Down Expand Up @@ -154,4 +154,12 @@ void settingCustomAttributesWithFluidBuilderAPIWorks() {
.getSequence(HPStateTag_CREATOR, HPStateTag_SpatialTransformSequence)
.get(0).getDouble(HPStateTag_CREATOR, HPStateTag_ViewZoom, VR.FD, 0, 0));
}

@Test
void callingBuildOnHolderBuilderReturnsAValidObjectContainingTheAttribute() {
int[] ratio = {1, 1};
PixelAspectRatio.Holder.Builder pixelAspectRatioHolderBuilder = PixelAspectRatio.Holder.builder()
.setPixelAspectRatio().asInts(ratio);
assertArrayEquals(ratio, pixelAspectRatioHolderBuilder.build().getPixelAspectRatio().getInts());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public class TypeddicomPublisherPlugin implements Plugin<Project> {
private static final String TYPEDDICOM_GROUP = "org.dcm4che";
private static final String TYPEDDICOM_VERSION = "0.5.2";
private static final String TYPEDDICOM_VERSION = "0.5.3";

private static final String STANDARD_PUBLICATION_NAME = "mavenJava";
private static final String GRADLE_PLUGIN_PUBLICATION_NAME = "pluginMaven";
Expand Down

0 comments on commit 375c652

Please sign in to comment.