Skip to content

Commit

Permalink
chore: migration from BitBucket to GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
grigoriev committed May 31, 2024
1 parent 1597603 commit 5442d69
Show file tree
Hide file tree
Showing 237 changed files with 22,000 additions and 19 deletions.
260 changes: 248 additions & 12 deletions README.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# tells Lombok that this is the root directory and that it shouldn’t search parent directories for more configuration files
config.stopBubbling = true
# tells Lombok to add @lombok.Generated annotation to all generated methods
lombok.addLombokGeneratedAnnotation = true
169 changes: 164 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,32 @@
<parent>
<groupId>ch.sbb.polarion.extensions</groupId>
<artifactId>ch.sbb.polarion.extension.generic.parent-pom</artifactId>
<version>2.0.0</version>
<version>4.9.1</version>
</parent>

<artifactId>ch.sbb.polarion.extension.extension-name</artifactId>
<version>0.0.0-SNAPSHOT</version>
<artifactId>ch.sbb.polarion.extension.pdf-exporter</artifactId>
<version>5.0.2-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
<maven-jar-plugin.Extension-Context>extension-name</maven-jar-plugin.Extension-Context>
<maven-jar-plugin.Automatic-Module-Name>ch.sbb.polarion.extension.extension_name</maven-jar-plugin.Automatic-Module-Name>
<pdfbox.version>3.0.2</pdfbox.version>
<okapi.xliff.version>1.46.0</okapi.xliff.version>

<slf4j.version>1.7.36</slf4j.version>
<testcontainers.version>1.19.8</testcontainers.version>
<javax.transaction-api.version>1.3</javax.transaction-api.version>
<byte-buddy.version>1.14.17</byte-buddy.version>

<exec-maven-plugin.version>3.3.0</exec-maven-plugin.version>
<weasyprint.version>61.2</weasyprint.version>
<awaitility.version>4.2.1</awaitility.version>

<maven-jar-plugin.Extension-Context>pdf-exporter</maven-jar-plugin.Extension-Context>
<maven-jar-plugin.Automatic-Module-Name>ch.sbb.polarion.extension.pdf_exporter</maven-jar-plugin.Automatic-Module-Name>
<web.app.name>${maven-jar-plugin.Extension-Context}</web.app.name>

<!--suppress UnresolvedMavenProperty -->
<maven-surefire-plugin.wpCommand>${HOME}/.local/bin/weasyprint</maven-surefire-plugin.wpCommand>
</properties>

<dependencies>
Expand All @@ -25,6 +39,81 @@
<artifactId>ch.sbb.polarion.extension.generic.app</artifactId>
<version>${project.parent.version}</version>
</dependency>

<dependency>
<groupId>com.polarion.thirdparty</groupId>
<artifactId>velocity-engine-core-2.3</artifactId>
<version>${polarion.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.polarion.alm.wiki</groupId>
<artifactId>sidecar</artifactId>
<version>${polarion.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>


<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>${pdfbox.version}</version>
<exclusions> <!-- pdfbox 3.0.0 has scope test for junit, pdfbox 3.0.1 has no such scope, that's why this exclusion has been added -->
<exclusion>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.okapi.lib</groupId>
<artifactId>okapi-lib-xliff2</artifactId>
<version>${okapi.xliff.version}</version>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${byte-buddy.version}</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>javax.transaction-api</artifactId>
<version>${javax.transaction-api.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${awaitility.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -37,6 +126,21 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>external-delivery</id>
<goals>
<goal>jar</goal>
</goals>
<phase>package</phase>
<configuration>
<classifier>external</classifier>
<excludes>
<exclude>default/cover-page/EuroSpec/**</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
Expand All @@ -48,6 +152,61 @@
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>

</plugins>
</build>

<profiles>
<profile>
<id>install-weasyprint</id>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${exec-maven-plugin.version}</version>
<executions>
<execution>
<id>pip-install</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>pip</executable>
<arguments>
<argument>install</argument>
<argument>weasyprint==${weasyprint.version}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>tests-with-weasyprint-cli</id>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<!-- hide unwanted exceptions logging -->
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<systemPropertyVariables>
<wpExporterImpl>command</wpExporterImpl>
<wpCommand>${maven-surefire-plugin.wpCommand}</wpCommand>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ch.sbb.polarion.extension.pdf.exporter;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public class PdfExportException extends RuntimeException {

private final String command;
private final int exitStatus;
private final byte[] out;
private final byte[] err;

@Override
public String getMessage() {
return "Process (" + this.command + ") exited with status code " + this.exitStatus + ":" + System.lineSeparator() + new String(err);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package ch.sbb.polarion.extension.pdf.exporter;

import ch.sbb.polarion.extension.generic.GenericUiServlet;
import ch.sbb.polarion.extension.generic.properties.CurrentExtensionConfiguration;
import ch.sbb.polarion.extension.pdf.exporter.properties.PdfExporterExtensionConfiguration;

import java.io.Serial;

public class PdfExporterAdminUiServlet extends GenericUiServlet {

@Serial
private static final long serialVersionUID = -6337912330074718317L;

public PdfExporterAdminUiServlet() {
super("pdf-exporter-admin");
CurrentExtensionConfiguration.getInstance().setExtensionConfiguration(PdfExporterExtensionConfiguration.getInstance());
}
}
Loading

0 comments on commit 5442d69

Please sign in to comment.