Skip to content

Commit 807d093

Browse files
authored
106 fix math type emission (#112)
* Set version replacement in usage.md * Add basic math type to predefined types
1 parent c3583e1 commit 807d093

14 files changed

Lines changed: 37 additions & 7 deletions

File tree

annotation/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>online.sharedtype</groupId>
66
<artifactId>sharedtype-parent</artifactId>
7-
<version>0.10.0-SNAPSHOT</version>
7+
<version>0.9.2-SNAPSHOT</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010

client-test/rust/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ pub static CUSTOM_CODE_TYPE: types::CustomInjectedStruct = types::CustomInjected
44
field: 33,
55
};
66

7+
pub static MATH_CLASS: types::MathClass = types::MathClass {
8+
bigInteger: 500000000i128,
9+
bigDecimal: 6.534543474564f64,
10+
};
11+
712
#[cfg(test)]
813
mod tests {
914
use std::collections::HashMap;

client-test/typescript/src/types.java17.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
type ArrayClass,
66
type JavaTimeClass,
77
type JodaTimeClass,
8+
type MathClass,
89
} from "./index.java17";
910

1011
export const list1: EnumGalaxy[] = ["Andromeda", "MilkyWay", "Triangulum"];
@@ -129,3 +130,8 @@ export const jodaTime: JodaTimeClass = {
129130
jodaLocalDateTime: "2022-01-01T00:00:00.000+08:00",
130131
jodaOffsetDateTime: "2022-01-01T00:00:00.000+08:00",
131132
}
133+
134+
export const mathClass: MathClass = {
135+
bigDecimal: 1,
136+
bigInteger: 1,
137+
}

doc/Usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Add Maven properties:
2323
```xml
2424
<properties>
2525
<compilerArg /> <!-- Placeholder -->
26-
<sharedtype.version>0.10.0</sharedtype.version>
26+
<sharedtype.version>0.9.1</sharedtype.version>
2727
<sharedtype.enabled>false</sharedtype.enabled> <!-- Disable by default so not to participate in every compilation -->
2828
</properties>
2929
```

internal/src/main/java/online/sharedtype/processor/domain/Constants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ public final class Constants {
6767
PREDEFINED_OBJECT_TYPES.put("java.lang.Object", OBJECT_TYPE_INFO);
6868
PREDEFINED_OBJECT_TYPES.put("java.lang.Class", CLASS_TYPE_INFO);
6969
PREDEFINED_OBJECT_TYPES.put("java.lang.Enum", ENUM_TYPE_INFO);
70+
PREDEFINED_OBJECT_TYPES.put("java.math.BigDecimal", BIG_DECIMAL_TYPE_INFO);
71+
PREDEFINED_OBJECT_TYPES.put("java.math.BigInteger", BIG_INTEGER_TYPE_INFO);
7072
}
7173

7274
public static final Set<TypeInfo> STRING_AND_NUMBER_TYPES = new HashSet<>(14);

it/java17/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>online.sharedtype</groupId>
66
<artifactId>sharedtype-it-parent</artifactId>
7-
<version>0.10.0-SNAPSHOT</version>
7+
<version>0.9.2-SNAPSHOT</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010

it/java8/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>online.sharedtype</groupId>
66
<artifactId>sharedtype-it-parent</artifactId>
7-
<version>0.10.0-SNAPSHOT</version>
7+
<version>0.9.2-SNAPSHOT</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package online.sharedtype.it.java8;
2+
3+
import online.sharedtype.SharedType;
4+
5+
import java.math.BigDecimal;
6+
import java.math.BigInteger;
7+
8+
@SharedType
9+
final class MathClass {
10+
private BigInteger bigInteger;
11+
private BigDecimal bigDecimal;
12+
}

it/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>online.sharedtype</groupId>
66
<artifactId>sharedtype-parent</artifactId>
7-
<version>0.10.0-SNAPSHOT</version>
7+
<version>0.9.2-SNAPSHOT</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010

misc/release.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ snapshotVersion=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceSt
2828
version="$(printf '%s' "$snapshotVersion" | sed -e "s/-SNAPSHOT//g")"
2929

3030
./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion="$version" --ntp -B
31+
sed -i -E "s/<sharedtype\.version>[0-9]+\.[0-9\.\[0-9]+\.[0-9]+<\/sharedtype\.version>/<sharedtype.version>$version<\/sharedtype.version>/g" doc/Usage.md
3132
./mvnw deploy -DskipTests -Prelease --ntp -B # to debug release can add -DskipPublishing=true to prevent actual upload
3233
NEW_VERSION="$(increment_version "$version" 1)-SNAPSHOT"
3334
./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion="$NEW_VERSION" --ntp -B

0 commit comments

Comments
 (0)