aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/validate-widget-archetype-osx.sh
blob: cef27ea2a369cde6a4fa77e8dddf748f86339401 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash

display_usage() {
echo -e "\nUsage:\n$0 <version> <framework staging id> <archetypes staging id> <plugin staging id>\n"
echo -e "Example: 7.3.7 1450 1451 1452"
}

# if less than two arguments supplied, display usage
if [  $# -le 3 ]
then
	display_usage
	exit 1
fi

# check whether user had supplied -h or --help . If yes display usage
if [[ ( $# == "--help") ||  $# == "-h" ]]
then
	display_usage
	exit 0
fi

VERSION=$1
VAADINREPO=comvaadin-$2
ARCHETYPEREPO=comvaadin-$3
PLUGINREPO=comvaadin-$4

# Only for Mac
MAC1=-e
MAC2=.foo

REPOBASE=https://oss.sonatype.org/content/repositories/
ART=test-widget-$VAADINVERSION
GROUP=testpkg
mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-widget -DarchetypeVersion=$VERSION -DarchetypeRepository=$REPOBASE$ARCHETYPEREPO -DgroupId=$GROUP -DartifactId=$ART -Dversion=1.0-SNAPSHOT -DinteractiveMode=false  -DComponentClassName=TestComponent
pushd $ART
# Add vaadin repo
sed $MAC1 "s#<repositories>#<repositories><repository><id>vaadin-$VERSION-staging</id><url>$REPOBASE$VAADINREPO</url></repository>#" -i $MAC2 */pom.xml
# Add vaadin and plugin repo as plugin repos
sed $MAC1 "s#<pluginRepositories>#<pluginRepositories><pluginRepository><id>vaadin-$VERSION-staging</id><url>$REPOBASE$VAADINREPO</url></pluginRepository>#" -i $MAC2 */pom.xml
sed $MAC1 "s#<pluginRepositories>#<pluginRepositories><pluginRepository><id>vaadin-$VERSION-plugin-staging</id><url>$REPOBASE$PLUGINREPO</url></pluginRepository>#" -i $MAC2 */pom.xml

pushd $ART && mvn install && popd
pushd $ART-demo && mvn package jetty:run