Skip to content

Commit

Permalink
Use a single main bundle (#1257)
Browse files Browse the repository at this point in the history
  • Loading branch information
ia3andy authored Jan 3, 2024
1 parent cf5ecd5 commit 9d3a11b
Show file tree
Hide file tree
Showing 41 changed files with 775 additions and 573 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
mvn -e -B -DskipTests=true clean package -Dlib
- name: Test
run: |
mvn -e -B verify -Dlib -Dacceptance-test
mvn -e -B verify -Pacceptance-test
76 changes: 76 additions & 0 deletions .github/workflows/release.actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Release CI

on:
pull_request:
types: [closed]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
release:
runs-on: ubuntu-latest
name: release
if: ${{github.event.pull_request.merged == true}}

steps:

- uses: actions/checkout@v4

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 21
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Configure Git author
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Maven release ${{steps.metadata.outputs.current-version}}
run: |
mvn -B release:prepare -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}} -Prelease
mvn -B release:perform -Darguments=-Dlib -Prelease
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

- name: Run JReleaser
uses: jreleaser/release-action@v2
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_PROJECT_VERSION: ${{ steps.metadata.outputs.current-version }}
with:
setup-java: false

# Persist logs
- name: JReleaser release output
if: always()
uses: actions/upload-artifact@v3
with:
name: jreleaser-release
path: |
out/jreleaser/trace.log
out/jreleaser/output.properties
- name: Push changes to ${{github.base_ref}} branch
run: |
git push
git push origin ${{steps.metadata.outputs.current-version}}
2 changes: 1 addition & 1 deletion base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
</build>
<profiles>
<profile>
<id>app</id>
<id>dev</id>
<activation>
<property>
<name>!lib</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public static List<CodeQuarkusExtension> processExtensions(ExtensionCatalog cata
public static CodeQuarkusExtension toCodeQuarkusExtension(
Extension ext,
Category cat,
AtomicInteger order
) {
AtomicInteger order) {
if (ext == null || ext.getName() == null) {
return null;
}
Expand Down
83 changes: 41 additions & 42 deletions base/src/main/java/io/quarkus/code/model/CodeQuarkusExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,21 @@

@JsonInclude(Include.NON_NULL)
public record CodeQuarkusExtension(
String id,
@Deprecated
String shortId,
String version,
String name,
String description,
String shortName,
String category,
List<String> tags,
Set<String> keywords,
@Deprecated
boolean providesExampleCode,
boolean providesCode,
String guide,
int order,
boolean platform,
String bom
) {
String id,
@Deprecated String shortId,
String version,
String name,
String description,
String shortName,
String category,
List<String> tags,
Set<String> keywords,
@Deprecated boolean providesExampleCode,
boolean providesCode,
String guide,
int order,
boolean platform,
String bom) {

public ExtensionRef toExtensionRef() {
return new ExtensionRef(id, version, platform);
Expand All @@ -37,22 +34,25 @@ public static Builder builder() {
return new Builder();
}

@Override public boolean equals(Object o) {
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
CodeQuarkusExtension that = (CodeQuarkusExtension) o;
return providesExampleCode == that.providesExampleCode && providesCode == that.providesCode && order == that.order
&& platform == that.platform && Objects.equals(id, that.id) && Objects.equals(shortId,
that.shortId) && Objects.equals(version, that.version) && Objects.equals(name, that.name)
&& Objects.equals(description, that.description) && Objects.equals(shortName, that.shortName)
&& Objects.equals(category, that.category) && Objects.equals(tags, that.tags)
&& Objects.equals(keywords, that.keywords) && Objects.equals(guide, that.guide)
&& Objects.equals(bom, that.bom);
&& platform == that.platform && Objects.equals(id, that.id) && Objects.equals(shortId,
that.shortId)
&& Objects.equals(version, that.version) && Objects.equals(name, that.name)
&& Objects.equals(description, that.description) && Objects.equals(shortName, that.shortName)
&& Objects.equals(category, that.category) && Objects.equals(tags, that.tags)
&& Objects.equals(keywords, that.keywords) && Objects.equals(guide, that.guide)
&& Objects.equals(bom, that.bom);
}

@Override public int hashCode() {
@Override
public int hashCode() {
return Objects.hash(id, shortId, version, name, description, shortName, category, tags, keywords, providesExampleCode,
providesCode, guide, order, platform, bom);
}
Expand Down Expand Up @@ -154,22 +154,21 @@ public Builder bom(String bom) {

public CodeQuarkusExtension build() {
return new CodeQuarkusExtension(
id,
shortId,
version,
name,
description,
shortName,
category,
tags,
keywords,
providesExampleCode,
providesCode,
guide,
order,
platform,
bom
);
id,
shortId,
version,
name,
description,
shortName,
category,
tags,
keywords,
providesExampleCode,
providesCode,
guide,
order,
platform,
bom);
}
}
}
3 changes: 2 additions & 1 deletion base/src/main/java/io/quarkus/code/model/CreatedProject.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package io.quarkus.code.model;

public record CreatedProject(String path) {}
public record CreatedProject(String path) {
}
8 changes: 3 additions & 5 deletions base/src/main/java/io/quarkus/code/model/ExtensionRef.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package io.quarkus.code.model;


public record ExtensionRef(
String id,
String version,
boolean platform
) {
String id,
String version,
boolean platform) {

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
public record GitHubCreatedRepository(
String ownerName,
String url,
String defaultBranch
) {}
String defaultBranch) {
}
4 changes: 2 additions & 2 deletions base/src/main/java/io/quarkus/code/model/GitHubToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
public record GitHubToken(
String accessToken,
String scope,
String tokenType
){}
String tokenType) {
}
31 changes: 11 additions & 20 deletions base/src/main/java/io/quarkus/code/model/ProjectDefinition.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,21 @@
public record ProjectDefinition(
String streamKey,

@NotEmpty
@Pattern(regexp = GROUPID_PATTERN)
String groupId,
@NotEmpty @Pattern(regexp = GROUPID_PATTERN) String groupId,

@NotEmpty
@Pattern(regexp = ARTIFACTID_PATTERN)
String artifactId,
@NotEmpty @Pattern(regexp = ARTIFACTID_PATTERN) String artifactId,

@NotEmpty
String version,
@NotEmpty String version,

@Pattern(regexp = CLASSNAME_PATTERN)
String className,
@Pattern(regexp = CLASSNAME_PATTERN) String className,

@Pattern(regexp = PATH_PATTERN)
String path,
@Pattern(regexp = PATH_PATTERN) String path,

@NotEmpty
@Pattern(regexp = BUILDTOOL_PATTERN)
String buildTool,
@NotEmpty @Pattern(regexp = BUILDTOOL_PATTERN) String buildTool,
Integer javaVersion,
Boolean noCode,
Boolean noExamples,
Set<String> extensions
) {
Set<String> extensions) {

public ProjectDefinition {
Objects.requireNonNull(groupId, "groupId is required");
Expand All @@ -65,9 +55,9 @@ public record ProjectDefinition(
public static final String PATH_PATTERN = "^\\/([a-z0-9\\-._~%!$&'()*+,;=:@]+\\/?)*$";
public static final String BUILDTOOL_PATTERN = "^(MAVEN)|(GRADLE)|(GRADLE_KOTLIN_DSL)$";


public static ProjectDefinition of() {
return new ProjectDefinition(null, DEFAULT_GROUPID, DEFAULT_ARTIFACTID, DEFAULT_VERSION, null, null, DEFAULT_BUILDTOOL, null, DEFAULT_NO_CODE, DEFAULT_NO_CODE, Set.of());
return new ProjectDefinition(null, DEFAULT_GROUPID, DEFAULT_ARTIFACTID, DEFAULT_VERSION, null, null, DEFAULT_BUILDTOOL,
null, DEFAULT_NO_CODE, DEFAULT_NO_CODE, Set.of());
}

@JsonCreator
Expand Down Expand Up @@ -148,7 +138,8 @@ public Builder extensions(Set<String> extensions) {
}

public ProjectDefinition build() {
return new ProjectDefinition(streamKey, groupId, artifactId, version, className, path, buildTool, javaVersion, noCode, noExamples, extensions);
return new ProjectDefinition(streamKey, groupId, artifactId, version, className, path, buildTool, javaVersion,
noCode, noExamples, extensions);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ public ProjectDefinition toProjectDefinition() {
javaVersion,
noCode,
noExamples,
extensions
);
extensions);
}

}
19 changes: 9 additions & 10 deletions base/src/main/java/io/quarkus/code/model/PublicConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@

@JsonInclude(Include.NON_NULL)
public record PublicConfig(
String environment,
String segmentWriteKey,
String sentryDSN,
String quarkusPlatformVersion,
String quarkusDevtoolsVersion,
@Deprecated
String quarkusVersion,
String gitHubClientId,
String gitCommitId
) {}
String environment,
String segmentWriteKey,
String sentryDSN,
String quarkusPlatformVersion,
String quarkusDevtoolsVersion,
@Deprecated String quarkusVersion,
String gitHubClientId,
String gitCommitId) {
}
18 changes: 9 additions & 9 deletions base/src/main/java/io/quarkus/code/model/Stream.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import java.util.SortedSet;

public record Stream(
String key,
String quarkusCoreVersion,
JavaCompatibility javaCompatibility,
String platformVersion,
boolean recommended,
String status,
boolean lts
) {
public static record JavaCompatibility(SortedSet<Integer> versions, int recommended) {}
String key,
String quarkusCoreVersion,
JavaCompatibility javaCompatibility,
String platformVersion,
boolean recommended,
String status,
boolean lts) {
public static record JavaCompatibility(SortedSet<Integer> versions, int recommended) {
}

public static StreamBuilder builder() {
return new StreamBuilder();
Expand Down
Loading

0 comments on commit 9d3a11b

Please sign in to comment.