Skip to content

Commit

Permalink
New attempt at MR jar release
Browse files Browse the repository at this point in the history
  • Loading branch information
FroMage committed Jul 16, 2020
1 parent 850657c commit d86195a
Show file tree
Hide file tree
Showing 26 changed files with 512 additions and 93 deletions.
47 changes: 47 additions & 0 deletions core-java8/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0"?>
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-context-propagation-parent</artifactId>
<version>1.0.14-SNAPSHOT</version>
</parent>
<artifactId>smallrye-context-propagation-java8</artifactId>
<name>smallrye-context-propagation</name>

<properties>
<javaVersion>8</javaVersion>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.install.skip>true</maven.install.skip>
</properties>

<!-- WARNING: keep these dependencies in sync with -core -->
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.context-propagation</groupId>
<artifactId>microprofile-context-propagation-api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>smallrye-context-propagation-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-api</artifactId>
<version>${version.microprofile.config}</version>
</dependency>
<dependency>
<groupId>org.jboss.threads</groupId>
<artifactId>jboss-threads</artifactId>
<version>${version.jboss.threads}</version>
</dependency>
</dependencies>
</project>
60 changes: 60 additions & 0 deletions core-java8/pom.xml.releaseBackup
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0"?>
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-context-propagation-parent</artifactId>
<version>1.0.3-SNAPSHOT</version>
</parent>
<artifactId>smallrye-context-propagation</artifactId>
<name>smallrye-context-propagation</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.context-propagation</groupId>
<artifactId>microprofile-context-propagation-api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>smallrye-context-propagation-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-api</artifactId>
<version>${version.microprofile.config}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
import java.util.function.Consumer;
import java.util.function.Function;

public class CompletableFutureWrapper<T> extends CompletableFuture<T> {
private final CompletableFuture<T> f;
import io.smallrye.context.impl.Contextualized;

public class CompletableFutureWrapper<T> extends CompletableFuture<T> implements Contextualized {
protected final CompletableFuture<T> f;
protected final SmallRyeThreadContext context;
/**
* If this executor is not null, we're wrapping a CF. If it is null, we're a dependent stage of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import java.util.function.Consumer;
import java.util.function.Function;

public class CompletionStageWrapper<T> implements CompletionStage<T> {
import io.smallrye.context.impl.Contextualized;

public class CompletionStageWrapper<T> implements CompletionStage<T>, Contextualized {
private final CompletionStage<T> f;
private final SmallRyeThreadContext context;

Expand Down
File renamed without changes.
27 changes: 27 additions & 0 deletions core-java9/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-context-propagation-parent</artifactId>
<version>1.0.14-SNAPSHOT</version>
</parent>
<artifactId>smallrye-context-propagation-java9</artifactId>
<name>smallrye-context-propagation</name>

<properties>
<javaVersion>9</javaVersion>
<maven.compiler.source>9</maven.compiler.source>
<maven.compiler.target>9</maven.compiler.target>
<maven.install.skip>true</maven.install.skip>
</properties>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>smallrye-context-propagation-java8</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
60 changes: 60 additions & 0 deletions core-java9/pom.xml.releaseBackup
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0"?>
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-context-propagation-parent</artifactId>
<version>1.0.3-SNAPSHOT</version>
</parent>
<artifactId>smallrye-context-propagation</artifactId>
<name>smallrye-context-propagation</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.context-propagation</groupId>
<artifactId>microprofile-context-propagation-api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>smallrye-context-propagation-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-api</artifactId>
<version>${version.microprofile.config}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;

import io.smallrye.context.CompletableFutureWrapper;
import io.smallrye.context.SmallRyeThreadContext;

public class Jdk9CompletableFutureWrapper<T> extends CompletableFutureWrapper<T> {

public Jdk9CompletableFutureWrapper(SmallRyeThreadContext context, CompletableFuture<T> f, Executor executor,
Expand All @@ -21,45 +18,46 @@ public <U> CompletableFuture<U> newIncompleteFuture() {
CompletableFuture<U> ret = new CompletableFuture<>();
return context.withContextCapture(ret, executor);
}

@Override
public Executor defaultExecutor() {
return executor;
}

@Override
public CompletableFuture<T> copy() {
// this relies on newIncompleteFuture which is already a wrapper
return super.copy();
return context.withContextCapture(f.copy(), executor);
}

@Override
public CompletionStage<T> minimalCompletionStage() {
// this creates a new MinimalStage we need to wrap
return context.withContextCapture(super.minimalCompletionStage());
return context.withContextCapture(f.minimalCompletionStage());
}

@Override
public CompletableFuture<T> completeAsync(Supplier<? extends T> supplier) {
// contextualise the action, but do not wrap return, which is "this"
return super.completeAsync(context.contextualSupplierUnlessContextualized(supplier));
// just forward
return context.withContextCapture(f.completeAsync(context.contextualSupplierUnlessContextualized(supplier), executor),
executor);
}

@Override
public CompletableFuture<T> completeAsync(Supplier<? extends T> supplier, Executor executor) {
// contextualise the action, but do not wrap return, which is "this"
return super.completeAsync(context.contextualSupplierUnlessContextualized(supplier), executor);
// just forward
return context.withContextCapture(f.completeAsync(context.contextualSupplierUnlessContextualized(supplier), executor),
this.executor);
}

@Override
public CompletableFuture<T> orTimeout(long timeout, TimeUnit unit) {
// do not wrap return, which is "this"
return super.orTimeout(timeout, unit);
// just forward
return context.withContextCapture(f.orTimeout(timeout, unit), executor);
}

@Override
public CompletableFuture<T> completeOnTimeout(T value, long timeout, TimeUnit unit) {
// do not wrap return, which is "this"
return super.completeOnTimeout(value, timeout, unit);
// just forward
return context.withContextCapture(f.completeOnTimeout(value, timeout, unit), executor);
}
}
37 changes: 37 additions & 0 deletions core/bin/mrjar.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>mvjar</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>io.smallrye:smallrye-context-propagation-java8</include>
</includes>
<binaries>
<unpack>true</unpack>
<includeDependencies>false</includeDependencies>
</binaries>
</moduleSet>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>io.smallrye:smallrye-context-propagation-java9</include>
</includes>
<binaries>
<outputDirectory>META-INF/versions/9</outputDirectory>
<unpack>true</unpack>
<includeDependencies>false</includeDependencies>
<unpackOptions>
<excludes>
<exclude>/META-INF/**</exclude>
</excludes>
</unpackOptions>
</binaries>
</moduleSet>
</moduleSets>
</assembly>
Loading

0 comments on commit d86195a

Please sign in to comment.