Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes I can't Remember Making that I had Locally #88

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ inputs:
default: 'manpages'
required: true

outputs:
archive-path:
description: "Archive Path"
value: build/sourcehawk-homebrew-tap-formula.tar.gz

runs:
using: "composite"
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: linux-native-image
path: distributions/linux/target/sourcehawk
path: ${{ steps.build.outputs.native-image-path }}

build-linux-distribution:
runs-on: ubuntu-latest
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,16 @@ jobs:
steps:
- name: Build
uses: optum/sourcehawk/.github/actions/build-homebrew-tap-formula-archive@main
- name: Upload Homebrew Tap Formula Archive
id: build
- name: Upload Homebrew Tap Formula Archive Release Asset
id: upload
if: success()
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.release-asset-upload-url }}
asset_path: homebrew/sourcehawk-homebrew-tap-formula.tar.gz
asset_path: ${{ steps.build.outputs.archive-path }}
asset_name: sourcehawk-${{ github.event.inputs.version }}-darwin-x86_64.tar.gz
asset_content_type: application/octet-stream

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ target/
log
logs
*.bak
.DS_Store

### STS ###
.apt_generated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ class ValidateConfigCommandSpec extends CliBaseSpecification {
String errorMessage = ValidateConfigCommand.deriveErrorMessage(context, e)

then:
errorMessage == "Parse error [Source: UNKNOWN; line: -1, column: -1] ${context}"
errorMessage.startsWith("Parse error [Source: UNKNOWN;")
errorMessage.endsWith("] ${context}")
}

def "deriveErrorMessage - cause JsonProcessingException"() {
Expand All @@ -279,7 +280,8 @@ class ValidateConfigCommandSpec extends CliBaseSpecification {
String errorMessage = ValidateConfigCommand.deriveErrorMessage(context, e)

then:
errorMessage == "Parse error [Source: UNKNOWN; line: -1, column: -1] ${context}"
errorMessage.startsWith("Parse error [Source: UNKNOWN;")
errorMessage.endsWith("] ${context}")
}

def "deriveErrorMessage - Exception"() {
Expand Down
24 changes: 0 additions & 24 deletions distributions/linux/native-image-builder/Dockerfile

This file was deleted.

277 changes: 9 additions & 268 deletions distributions/linux/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,281 +18,22 @@
<packaging>pom</packaging>

<properties>
<graalvm.version/> <!-- Defined in jdk specific profile -->
<docker.image>${project.artifactId}-native-image-builder</docker.image>
<docker.workdir>/home/${global.project.name}</docker.workdir>
<docker.build.executable>${docker.workdir}/${global.project.name}</docker.build.executable>
<native.image>${project.build.directory}/${global.project.name}</native.image>
<maven.deploy.skip>true</maven.deploy.skip>
<native.image.path/>
</properties>

<dependencies>
<dependency>
<groupId>com.optum.sourcehawk</groupId>
<artifactId>sourcehawk-cli</artifactId>
<classifier>native-image</classifier>
<scope>provided</scope>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>2.1-groovy-3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.optum.sourcehawk</groupId>
<artifactId>sourcehawk-cli</artifactId>
<version>${project.version}</version>
<classifier>completion</classifier>
<type>sh</type>
<scope>provided</scope>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.36</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>

<plugins>

<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-manpages</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>${maven.multiModuleProjectDirectory}/gh-pages/manpages</directory>
<includes>
<include>${global.project.name}*</include>
</includes>
</resource>
</resources>
<outputDirectory>${project.build.directory}/dist/manpages</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>

<!-- COPY NATIVE IMAGE DEPENDENCIES -->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-native-image</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>com.optum.sourcehawk</includeGroupIds>
<includeArtifactIds>sourcehawk-cli</includeArtifactIds>
<includeClassifiers>native-image</includeClassifiers>
<outputDirectory>${project.build.directory}/dist</outputDirectory>
</configuration>
</execution>
<execution>
<id>copy-native-image-completion-script</id>
<phase>prepare-package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.optum.sourcehawk</groupId>
<artifactId>sourcehawk-cli</artifactId>
<classifier>completion</classifier>
<type>sh</type>
<outputDirectory>${project.build.directory}/dist/completion</outputDirectory>
<destFileName>${global.project.name}</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>

<!-- BUILD NATIVE IMAGE -->
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<executions>
<execution>
<id>build-native-image</id>
<phase>prepare-package</phase>
<goals>
<goal>build</goal>
<goal>tag</goal>
</goals>
<configuration>
<dockerfile>${basedir}/native-image-builder/Dockerfile</dockerfile>
<repository>${docker.image}</repository>
<tag>${project.version}</tag>
<buildArgs>
<GRAALVM_VERSION>${graalvm.version}</GRAALVM_VERSION>
<JAR>target/dist/sourcehawk-cli-${project.version}-native-image.jar</JAR>
<WORKDIR>${docker.workdir}</WORKDIR>
</buildArgs>
<skipDockerInfo>true</skipDockerInfo>
</configuration>
</execution>
</executions>
</plugin>

<!-- EXEC PROCESSORS AND SCRIPTS -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>

<!-- EXTRACT NATIVE IMAGE FROM DOCKER CONTAINER TO TARGET DIRECTORY -->
<execution>
<id>extract-native-image</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>../scripts/extract-file-from-docker-container.sh</executable>
<arguments>
<argument>${docker.image}:${project.version}</argument>
<argument>${docker.build.executable}</argument>
<argument>${project.build.directory}</argument>
</arguments>
</configuration>
</execution>

</executions>
</plugin>

<!-- ATTACH NATIVE IMAGE ARTIFACT-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-native-image-artifact</id>
<goals>
<goal>attach-artifact</goal>
</goals>
<phase>post-integration-test</phase>
<configuration>
<artifacts>
<artifact>
<file>${native.image}</file>
<classifier>x86_64</classifier>
<type>zip</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>

<profiles>

<!-- Windows profile -->
<profile>
<id>windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<!-- MacOS profile -->
<profile>
<id>mac</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<!-- LINUX INTEGRATION TESTS -->
<profile>
<id>linux-integration-tests</id>
<activation>
<os>
<family>unix</family>
<name>Linux</name>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>

<!-- VERIFY EXECUTABLE -->
<execution>
<id>verify-native-image-execution</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${native.image}</executable>
<arguments>
<argument>--version</argument>
</arguments>
</configuration>
</execution>

</executions>
</plugin>
</plugins>
</build>
</profile>

<!-- JAVA 11 NATIVE IMAGE BUILD -->
<profile>
<id>java11</id>
<activation>
<jdk>11</jdk>
</activation>
<properties>
<graalvm.version>22.0.0-java11</graalvm.version>
</properties>
</profile>

<!-- JAVA 17 NATIVE IMAGE BUILD -->
<profile>
<id>java17</id>
<activation>
<jdk>17</jdk>
</activation>
<properties>
<graalvm.version>22.0.0-java17</graalvm.version>
</properties>
</profile>

</profiles>

</project>
Loading