Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ jobs:
path: ~/.m2/repository
key: build_maven
- name: Build
run: ./mvnw install -e
run: ./mvnw install -e --ntp -B
- name: Javadoc
run: ./mvnw -P release javadoc:javadoc --ntp -B
- name: Upload generated sources
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -80,7 +82,7 @@ jobs:
path: ~/.m2/repository
key: build_maven
- name: Test
run: ./mvnw verify -pl it/java8 -e
run: ./mvnw verify -pl it/java8 -e --ntp -B

client_test:
needs: [build_and_test]
Expand Down
7 changes: 2 additions & 5 deletions annotation/src/main/java/online/sharedtype/SharedType.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
* Type hierarchy will be flattened that a subtype's inherited properties will be included in its own declared properties,
* while, by default, any supertypes will not be emitted again.</li>
* </ul>
* </p>
*
* <p>
* <b>Inner classes:</b><br>
Expand All @@ -48,11 +47,10 @@
* </p>
*
* <p>
* <b>Cyclic Reference:</b><br>
* <b>Cyclic Reference:</b>
* <ul>
* <li>Rust: Cyclic references will be wrapped in {@code Option<Box<T>>}.</li>
* </ul>
* </p>
*
* <p>
* <b>Constants:</b><br>
Expand All @@ -72,9 +70,8 @@
* <li>Rust: {@code Vec<T>}</li>
* </ul>
*
* Maps are mapped to:
* <p>
* <b>Maps:</b><br>
* <b>Maps:</b>
* (Not supported yet.)
* <ul>
* <li>Typescript: {@code [key: string]: T} where {@code T} can be a reified type.</li>
Expand Down
8 changes: 8 additions & 0 deletions doc/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,11 @@ Do not use compile time heavy annotation like `lombok.val`.
## Release
Release is via Sonatype [Central Portal](https://central.sonatype.org/register/central-portal/). Snapshot release is not supported.
Create a GitHub release, GitHub action will automatically deploy to Sonatype. Version will be automatically bumped by the action.

To Test Javadoc locally:
```bash
./mvnw -P release javadoc:javadoc
```
Then open `annotation/target/reports/apidocs/index.html`.

To test deployment, see [release](../misc/release.sh).
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public final class ConcreteTypeInfo implements TypeInfo {

/**
* The counter-parting type definition.
* @see this#typeDef()
* @see #typeDef()
*/
@Nullable
private TypeDef typeDef;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public interface TypeInfo extends Serializable {
* <p>Check if this type and its dependency types are resolved.</p>
* <p>
* When parsing a type's structure, a dependency type is firstly captured as a {@link TypeInfo}.
* At this stage, because we don't know its output structure or if it needs output at all, we mark it as unresolved.
* Also due to possible cyclic dependencies, the resolution stage needs to be performed after initial parsing state.
* At this stage, because we don't know its output structure or if it needs to be output at all, we mark it as unresolved.
* Also, due to possible cyclic dependencies, the resolution stage needs to be performed after initial parsing state.
* During resolution, once a type is parsed, it's marked as resolved.
* Note that a type is marked as resolved when created, if it can be determined at that time.
* </p>
Expand All @@ -28,7 +28,7 @@ public interface TypeInfo extends Serializable {
/**
* Replace type variables with type arguments.
* @param mappings key is a type variable e.g. T
* value is a type argument, a concrete type e.g. Integer, or a generic type with concrete type parameter, e.g. Tuple<String, String></>
* value is a type argument, a concrete type e.g. Integer, or a generic type with concrete type parameter, e.g. {@code Tuple<String, String>}
* @return a newly created type info if updated.
*/
TypeInfo reify(Map<TypeVariableInfo, TypeInfo> mappings);
Expand Down
11 changes: 8 additions & 3 deletions misc/release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
#set -e

# To test locally, need to prepare GPG keys
# gpg --gen-key
# See also: https://maven.apache.org/plugins/maven-gpg-plugin/
# See also: https://stackoverflow.com/questions/3174537/how-to-transfer-pgp-private-key-to-another-computer

if [ -z "$MAVEN_GPG_PASSPHRASE" ];then
echo "No MAVEN_GPG_PASSPHRASE provided, exit 1"
exit 1
Expand All @@ -22,8 +27,8 @@ increment_version() {
snapshotVersion=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
version="$(printf '%s' "$snapshotVersion" | sed -e "s/-SNAPSHOT//g")"

./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion="$version"
./mvnw deploy -DskipTests -Prelease # to debug release can add -DskipPublishing=true to prevent actual upload
./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion="$version" --ntp -B
./mvnw deploy -DskipTests -Prelease --ntp -B # to debug release can add -DskipPublishing=true to prevent actual upload
NEW_VERSION="$(increment_version "$version" 1)-SNAPSHOT"
./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion="$NEW_VERSION"
./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion="$NEW_VERSION" --ntp -B
printf '%s' "$NEW_VERSION" > NEW_VERSION.cache