-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a working sampler for project with artifacts
- Loading branch information
Krzysztof Suszynski
committed
May 23, 2019
1 parent
57ffd6f
commit 8047231
Showing
32 changed files
with
765 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tools/plugs-packager-core/src/main/resources/META-INF/sisu/javax.inject.Named
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pl.wavesoftware.plugs.tools.packager.core.jar.ProjectDigestImpl | ||
pl.wavesoftware.plugs.tools.packager.core.digest.ProjectDigestImpl | ||
pl.wavesoftware.plugs.tools.packager.core.manifest.ManifestBuilderImpl | ||
pl.wavesoftware.plugs.tools.packager.core.DefaultPackagerFactory | ||
pl.wavesoftware.plugs.tools.packager.core.DefaultRepackagingIsRequiredFactory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...gs-packager-samples/src/main/java/pl/wavesoftware/plugs/tools/packager/sample/Sample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (c) 2019 Wave Software | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package pl.wavesoftware.plugs.tools.packager.sample; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public interface Sample<T> extends Supplier<T>, AutoCloseable { | ||
@Override | ||
void close(); | ||
|
||
interface Easy<T> extends Sample<T> { | ||
@Override | ||
default void close() { | ||
// nothing here | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...amples/src/main/java/pl/wavesoftware/plugs/tools/packager/sample/SamplerContextProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (c) 2019 Wave Software | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package pl.wavesoftware.plugs.tools.packager.sample; | ||
|
||
import io.vavr.Lazy; | ||
|
||
import java.util.function.Supplier; | ||
|
||
final class SamplerContextProxy implements SamplerContext { | ||
|
||
private final Lazy<SamplerContext> context; | ||
|
||
SamplerContextProxy(Supplier<SamplerContext> supplier) { | ||
this.context = Lazy.of(supplier); | ||
} | ||
|
||
@Override | ||
public <T> T get(SampleSpec<T> spec) { | ||
return context.get().get(spec); | ||
} | ||
|
||
@Override | ||
public <T> Sample<T> createNew(SampleSpec<T> spec) { | ||
return context.get().createNew(spec); | ||
} | ||
|
||
@Override | ||
public void close() { | ||
if (context.isEvaluated()) { | ||
context.get().close(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...samples/src/main/java/pl/wavesoftware/plugs/tools/packager/sample/artifact/Artifacts.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (c) 2019 Wave Software | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package pl.wavesoftware.plugs.tools.packager.sample.artifact; | ||
|
||
import pl.wavesoftware.plugs.tools.packager.api.model.Artifact; | ||
import pl.wavesoftware.plugs.tools.packager.sample.SampleSpec; | ||
|
||
public enum Artifacts implements SampleSpec<Artifact> { | ||
SIMPLE, | ||
HIBERNATE, | ||
JSR305, | ||
OSGI_CORE | ||
} |
Oops, something went wrong.