Skip to content

Commit

Permalink
fix: only release generator executable; resolve child POMs
Browse files Browse the repository at this point in the history
  • Loading branch information
worstell committed Nov 27, 2023
1 parent b897f10 commit c9daf41
Show file tree
Hide file tree
Showing 6 changed files with 247 additions and 93 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
workflow_dispatch:g
name: Release
jobs:
build-runner:
Expand Down Expand Up @@ -113,13 +113,14 @@ jobs:
- name: Publish JARs # Snapshots are published first, then the tagged release
run: |
mvn -U --batch-mode clean deploy -P release
mvn --batch-mode versions:set -DnewVersion=$(git describe --tags --abbrev=0 | cut -c2-) -DprocessAllModules -DgenerateBackupPoms=false
mvn -U --batch-mode clean deploy -P release
mvn -Drevision=$(git describe --tags --abbrev=0 | cut -c2-) -U --batch-mode clean deploy -P release
env:
SIGN_KEY_PASS: ${{ secrets.GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GITHUB_TOKEN: ${{ github.token }}
- name: Remove `.flattened_pom.xml` files
run: git clean -f *.flattened_pom.xml
create-release:
name: Release Go Binaries
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions Bitfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ KT_RUNTIME_OUT = kotlin-runtime/ftl-runtime/target/ftl-runtime-1.0-SNAPSHOT.jar
KT_RUNTIME_RUNNER_TEMPLATE_OUT = build/template/ftl/jars/ftl-runtime.jar

KT_GENERATOR_IN = kotlin-runtime/ftl-generator/**/*.{kt,kts} pom.xml kotlin-runtime/ftl-runtime/**/pom.xml %{KT_RUNTIME_OUT}
KT_GENERATOR_OUT = kotlin-runtime/ftl-generator/target/ftl-generator-1.0-SNAPSHOT-jar-with-dependencies.jar
KT_GENERATOR_OUT = kotlin-runtime/ftl-generator/target/ftl-generator-1.0-SNAPSHOT.jar

CLIENT_OUT = frontend/dist/index.html
CLIENT_IN = frontend/src/**/*
Expand Down Expand Up @@ -108,13 +108,13 @@ kotlin-runtime/scaffolding.zip: kotlin-runtime/scaffolding/**/*
%{KT_RUNTIME_OUT}: %{KT_RUNTIME_IN} %{PROTO_IN}
build:
mvn -N install
mvn -pl :ftl-runtime install
mvn -pl :ftl-runtime -am install
+clean: mvn -pl :ftl-runtime clean

%{KT_GENERATOR_OUT}: %{KT_GENERATOR_IN}
build:
mvn -N install
mvn -pl :ftl-generator install
mvn -pl :ftl-generator -am install
+clean: mvn -pl :ftl-generator clean

%(dirname %{KT_RUNTIME_RUNNER_TEMPLATE_OUT})%:
Expand Down
4 changes: 2 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ install-root-jar:

# Install ftl-generator JAR to local Maven repository
install-generator-jar:
mvn -pl :ftl-generator install
mvn -pl :ftl-generator -am install

# Install ftl-runtime JAR to local Maven repository
install-runtime-jar:
mvn -pl :ftl-runtime install
mvn -pl :ftl-runtime -am install

# Deploy the Go time module
deploy-time:
Expand Down
85 changes: 72 additions & 13 deletions kotlin-runtime/ftl-generator/pom.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>xyz.block</groupId>
<artifactId>ftl</artifactId>
<version>1.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>ftl-generator</artifactId>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>

<properties>
<rootDir>${basedir}/../..</rootDir>
<maven.deploy.skip>false</maven.deploy.skip>
Expand All @@ -28,35 +30,60 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>ftl-runtime</artifactId>
<version>${project.parent.version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.ajalt.clikt</groupId>
<artifactId>clikt-jvm</artifactId>
<version>4.2.1</version>
</dependency>
<dependency>
<groupId>com.squareup.wire</groupId>
<artifactId>wire-runtime-jvm</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.wire</groupId>
<artifactId>wire-grpc-server</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.wire</groupId>
<artifactId>wire-grpc-client-jvm</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>shade-jar</id>
<phase>package</phase>
<goals>
<goal>single</goal>
<goal>shade</goal>
</goals>
<configuration>
<archive>
<manifest>
<shadedArtifactAttached>false</shadedArtifactAttached>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>xyz.block.ftl.generator.MainKt</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</transformer>
</transformers>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
Expand Down Expand Up @@ -89,4 +116,36 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>shade-jar</id>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<executions>
<execution>
<id>flatten</id>
<phase>package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
55 changes: 48 additions & 7 deletions kotlin-runtime/ftl-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
<parent>
<groupId>xyz.block</groupId>
<artifactId>ftl</artifactId>
<version>1.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>ftl-runtime</artifactId>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>

<properties>
<rootDir>${basedir}/../..</rootDir>
<maven.deploy.skip>false</maven.deploy.skip>
Expand All @@ -27,12 +29,6 @@
<version>1.9.21</version>
</dependency>

<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-core</artifactId>
<version>1.7.3</version>
</dependency>

<dependency>
<groupId>io.gitlab.arturbosch.detekt</groupId>
<artifactId>detekt-api</artifactId>
Expand All @@ -53,6 +49,51 @@
<version>2.10.1</version>
</dependency>

<dependency>
<groupId>com.squareup.wire</groupId>
<artifactId>wire-runtime-jvm</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.wire</groupId>
<artifactId>wire-grpc-server</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.wire</groupId>
<artifactId>wire-grpc-client-jvm</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
</dependency>
<dependency>
<groupId>org.hotswapagent</groupId>
<artifactId>hotswap-agent-core</artifactId>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>io.gitlab.arturbosch.detekt</groupId>
Expand Down
Loading

0 comments on commit c9daf41

Please sign in to comment.