forked from alibaba/COLA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ add new-cola-*-component.sh scripts
- Loading branch information
Showing
6 changed files
with
90 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
# COLA Dev Helper Archetypes | ||
# COLA Dev Util Archetypes | ||
|
||
用于开发时快速生成`COLA Components`工程的Archetypes。 | ||
|
||
即方便COLA开发的工具工程。 | ||
|
||
提供了脚本,调用`Util Archetypes`生成`COLA Components`工程: | ||
|
||
- [`new-cola-normal-component.sh`](new-cola-normal-component.sh) | ||
- [`new-cola-starter-component.sh`](new-cola-starter-component.sh) |
37 changes: 37 additions & 0 deletions
37
cola-components/dev-util-archetypes/new-cola-normal-component.sh
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,37 @@ | ||
#!/bin/bash | ||
set -eEuo pipefail | ||
# adjust current dir to script dir | ||
cd "$(dirname "$(readlink -f "$0")")" | ||
|
||
source ../../scripts/common.sh | ||
source ../../scripts/common_build.sh | ||
|
||
# shellcheck disable=SC2154 | ||
[ $# -ne 1 ] && die "need only 1 argument for component name!$nl${nl}usage:$nl $0 hello" | ||
readonly component_name="$1" | ||
readonly archetype_dir=cola-normal-component-archetype | ||
|
||
( | ||
cd "$archetype_dir" | ||
MVN_WITH_BASIC_OPTIONS install | ||
) | ||
|
||
groupId=$(extractFirstElementValueFromPom groupId ../pom.xml) | ||
component_version=$(extractFirstElementValueFromPom version ../pom.xml) | ||
|
||
archetypeGroupId=$(extractFirstElementValueFromPom groupId "$archetype_dir/pom.xml") | ||
archetypeArtifactId=$(extractFirstElementValueFromPom artifactId "$archetype_dir/pom.xml") | ||
archetypeVersion=$(extractFirstElementValueFromPom version "$archetype_dir/pom.xml") | ||
|
||
cd .. | ||
|
||
MVN_WITH_BASIC_OPTIONS archetype:generate \ | ||
-DgroupId="$groupId" \ | ||
-DartifactId="cola-component-$component_name" \ | ||
-Dversion="$component_version" \ | ||
-Dpackage="com.alibaba.cola.$component_name" \ | ||
-DarchetypeGroupId="$archetypeGroupId" \ | ||
-DarchetypeArtifactId="$archetypeArtifactId" \ | ||
-DarchetypeVersion="$archetypeVersion" \ | ||
-DinteractiveMode=false \ | ||
-DarchetypeCatalog=local |
36 changes: 36 additions & 0 deletions
36
cola-components/dev-util-archetypes/new-cola-starter-component.sh
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,36 @@ | ||
#!/bin/bash | ||
set -eEuo pipefail | ||
# adjust current dir to script dir | ||
cd "$(dirname "$(readlink -f "$0")")" | ||
|
||
source ../../scripts/common.sh | ||
source ../../scripts/common_build.sh | ||
|
||
# shellcheck disable=SC2154 | ||
[ $# -ne 1 ] && die "need only 1 argument for component name!$nl${nl}usage:$nl $0 hello" | ||
readonly component_name="$1" | ||
readonly archetype_dir=cola-starter-component-archetype | ||
|
||
( | ||
cd "$archetype_dir" | ||
MVN_WITH_BASIC_OPTIONS install | ||
) | ||
|
||
groupId=$(extractFirstElementValueFromPom groupId ../pom.xml) | ||
component_version=$(extractFirstElementValueFromPom version ../pom.xml) | ||
|
||
archetypeGroupId=$(extractFirstElementValueFromPom groupId "$archetype_dir/pom.xml") | ||
archetypeArtifactId=$(extractFirstElementValueFromPom artifactId "$archetype_dir/pom.xml") | ||
archetypeVersion=$(extractFirstElementValueFromPom version "$archetype_dir/pom.xml") | ||
|
||
cd .. | ||
MVN_WITH_BASIC_OPTIONS archetype:generate \ | ||
-DgroupId="$groupId" \ | ||
-DartifactId="cola-component-$component_name-starter" \ | ||
-Dversion="$component_version" \ | ||
-Dpackage="com.alibaba.cola.$component_name" \ | ||
-DarchetypeGroupId="$archetypeGroupId" \ | ||
-DarchetypeArtifactId="$archetypeArtifactId" \ | ||
-DarchetypeVersion="$archetypeVersion" \ | ||
-DinteractiveMode=false \ | ||
-DarchetypeCatalog=local |
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