Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SHRINKRES-194 Multi-module Gradle project support
- Loading branch information
Showing
7 changed files
with
109 additions
and
6 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
impl-gradle-embedded-archive/src/it/multi-module-sample/build.gradle
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,5 @@ | ||
apply plugin: 'maven' | ||
|
||
group = 'org.jboss.shrinkwrap.resolver.test' | ||
version = '1.0.0' | ||
description = """ShrinkWrap Resolver Maven Archie Implementation Tests: Multi-Module Sample""" |
13 changes: 13 additions & 0 deletions
13
impl-gradle-embedded-archive/src/it/multi-module-sample/module-one/build.gradle
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,13 @@ | ||
apply plugin: 'java' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile 'commons-codec:commons-codec:1.7' | ||
testCompile 'junit:junit:4.10' | ||
compile('org.jboss.spec:jboss-javaee-web-6.0:3.0.2.Final') { | ||
exclude(module: 'xalan') | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...e-embedded-archive/src/it/multi-module-sample/module-one/src/main/java/test/JarClass.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,13 @@ | ||
package test; | ||
|
||
import javax.ejb.Stateless; | ||
|
||
@Stateless | ||
public class JarClass { | ||
|
||
public static final String GREETINGS = "Hello from EmbeddedGradleImporter imported class"; | ||
|
||
public String greet() { | ||
return GREETINGS; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
impl-gradle-embedded-archive/src/it/multi-module-sample/module-two/build.gradle
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,10 @@ | ||
apply plugin: 'java' | ||
apply plugin: 'war' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile(project(':module-one')) | ||
} |
2 changes: 2 additions & 0 deletions
2
impl-gradle-embedded-archive/src/it/multi-module-sample/settings.gradle
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,2 @@ | ||
include "module-one" | ||
include "module-two" |
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
21 changes: 21 additions & 0 deletions
21
...wrap/impl/gradle/archive/importer/embedded/MultiModuleEmbeddedGradleImporterTestCase.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,21 @@ | ||
package org.jboss.shrinkwrap.impl.gradle.archive.importer.embedded; | ||
|
||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.gradle.archive.importer.embedded.EmbeddedGradleImporter; | ||
import org.jboss.shrinkwrap.api.spec.WebArchive; | ||
import org.junit.Test; | ||
|
||
/** | ||
* @author <a href="mailto:mmatloka@gmail.com">Michal Matloka</a> | ||
*/ | ||
public class MultiModuleEmbeddedGradleImporterTestCase { | ||
|
||
@Test | ||
public void should() { | ||
final String dir = "src/it/multi-module-sample/module-two"; | ||
final WebArchive webArchive = ShrinkWrap.create(EmbeddedGradleImporter.class).forProjectDirectory(dir) | ||
.importBuildOutput().as(WebArchive.class); | ||
|
||
AssertArchive.assertContains(webArchive, "/WEB-INF/lib/module-one.jar"); | ||
} | ||
} |