Skip to content

Commit da9e12c

Browse files
ngonzalezpazFCjavier-godoy
authored andcommitted
build: add demo-jar profile
1 parent 3ea0a1d commit da9e12c

File tree

5 files changed

+64
-1
lines changed

5 files changed

+64
-1
lines changed

assembly/assembly.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
<include>*.jar</include>
2828
<include>*.pdf</include>
2929
</includes>
30+
<excludes>
31+
<exclude>*-tests.jar</exclude>
32+
</excludes>
3033
</fileSet>
3134
</fileSets>
3235

pom.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,34 @@
243243
</plugins>
244244
</build>
245245
</profile>
246+
<profile>
247+
<id>demo-jar</id>
248+
<build>
249+
<plugins>
250+
<plugin>
251+
<groupId>org.apache.maven.plugins</groupId>
252+
<artifactId>maven-jar-plugin</artifactId>
253+
<executions>
254+
<execution>
255+
<goals>
256+
<goal>test-jar</goal>
257+
</goals>
258+
<configuration>
259+
<classifier>demo</classifier>
260+
<excludes>
261+
<exclude>META-INF/resources/frontend/styles/shared-styles.css</exclude>
262+
<exclude>**/test/*</exclude>
263+
<exclude>**/integration/*</exclude>
264+
<exclude>**/DemoView.class</exclude>
265+
<exclude>**/DemoLayout.class</exclude>
266+
</excludes>
267+
</configuration>
268+
</execution>
269+
</executions>
270+
</plugin>
271+
</plugins>
272+
</build>
273+
</profile>
246274
</profiles>
247275
</project>
248276

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.flowingcode.vaadin.addons;
2+
3+
import com.vaadin.flow.component.html.Div;
4+
import com.vaadin.flow.router.RouterLayout;
5+
6+
@SuppressWarnings("serial")
7+
public class DemoLayout extends Div implements RouterLayout {
8+
9+
public DemoLayout() {
10+
setSizeFull();
11+
}
12+
13+
}

src/test/java/com/flowingcode/vaadin/addons/chipfield/ChipfieldDemoView.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.flowingcode.vaadin.addons.chipfield;
22

3+
import com.flowingcode.vaadin.addons.DemoLayout;
34
import com.vaadin.flow.component.checkbox.Checkbox;
45
import com.vaadin.flow.component.html.IFrame;
56
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
@@ -10,7 +11,7 @@
1011
import com.vaadin.flow.router.Route;
1112

1213
@SuppressWarnings("serial")
13-
@Route("chipfield")
14+
@Route(value = "chipfield", layout = DemoLayout.class)
1415
public class ChipfieldDemoView extends VerticalLayout {
1516

1617
private static final String DATAPROVIDER_DEMO = "Data Provider";
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.flowingcode.vaadin.addons.chipfield.test;
2+
3+
import static org.junit.Assert.assertEquals;
4+
import static org.junit.Assert.assertNotEquals;
5+
import org.junit.Test;
6+
import com.flowingcode.vaadin.addons.DemoLayout;
7+
import com.flowingcode.vaadin.addons.chipfield.ChipfieldDemoView;
8+
import com.vaadin.flow.router.Route;
9+
10+
public class LayoutTest {
11+
@Test
12+
public void testDemoLayout() {
13+
Route route = ChipfieldDemoView.class.getAnnotation(Route.class);
14+
assertEquals("com.flowingcode.vaadin.addons.DemoLayout",DemoLayout.class.getName());
15+
assertEquals(DemoLayout.class, route.layout());
16+
assertNotEquals("", route.value());
17+
}
18+
}

0 commit comments

Comments
 (0)