This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-305
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-305 by this push:
new b6031d4 WIP.
b6031d4 is described below
commit b6031d492d7e4018c0a0b4a3cf45f05baccd2dc9
Author: Sergey Kamov <[email protected]>
AuthorDate: Mon Apr 26 22:47:19 2021 +0300
WIP.
---
bin/prepare.sh | 116 +++++++++++++++++++--
nlpcraft-examples/minecraft-mod/.gitignore | 1 +
nlpcraft-examples/minecraft-mod/build.gradle | 4 +-
.../gradle/wrapper/gradle-wrapper.jar | Bin 54708 -> 0 bytes
.../gradle/wrapper/gradle-wrapper.properties | 5 -
5 files changed, 109 insertions(+), 17 deletions(-)
diff --git a/bin/prepare.sh b/bin/prepare.sh
index f667b2b..d7e5bfb 100755
--- a/bin/prepare.sh
+++ b/bin/prepare.sh
@@ -16,6 +16,8 @@
# limitations under the License.
#
+# Make sure that maven and gradle installed on your PC.
+
if [[ $1 = "" ]] ; then
echo "Version must be set as input parameter."
exit 1
@@ -32,40 +34,116 @@ zipFileBin=apache-nlpcraft-incubating-bin-$1.zip # NOT an
official ASF release.
zipFileSrc=apache-nlpcraft-incubating-$1.zip # An OFFICIAL ASF release.
coreModule=nlpcraft
stanfordModule=nlpcraft-stanford
+examples=nlpcraft-examples
+exampleAlarm=${examples}/alarm
+exampleEcho=${examples}/echo
+exampleHelloworld=${examples}/helloworld
+exampleLightswitch=${examples}/lightswitch
+exampleMinecraft=${examples}/minecraft
+exampleMinecraftMod=${examples}/minecraft-mod
+examplePhone=${examples}/phone
+exampleSql=${examples}/sql
+exampleTime=${examples}/time
+exampleWeather=${examples}/weather
curDir=$(pwd)
cd ../
-mvn clean package -P stanford-corenlp,release
+mvn clean package -P stanford-corenlp,release,examples
+
+cd nlpcraft-examples/minecraft-mod || exit
+./gradlew clean build
+
+cd ../../
rm -R ${zipDir} 2> /dev/null
-mkdir ${zipDir}
-mkdir ${zipDir}/${tmpDir}
-mkdir ${zipDir}/${tmpDir}/${coreModule}
+mkdir -p ${zipDir}/${tmpDir}/${coreModule}
+mkdir -p ${zipDir}/${tmpDir}/${stanfordModule}
+mkdir -p ${zipDir}/${tmpDir}/${exampleAlarm}
+mkdir -p ${zipDir}/${tmpDir}/${exampleEcho}
+mkdir -p ${zipDir}/${tmpDir}/${exampleHelloworld}
+mkdir -p ${zipDir}/${tmpDir}/${exampleLightswitch}
+mkdir -p ${zipDir}/${tmpDir}/${exampleMinecraft}
+mkdir -p ${zipDir}/${tmpDir}/${exampleMinecraftMod}
+mkdir -p ${zipDir}/${tmpDir}/${examplePhone}
+mkdir -p ${zipDir}/${tmpDir}/${exampleSql}
+mkdir -p ${zipDir}/${tmpDir}/${exampleTime}
+mkdir -p ${zipDir}/${tmpDir}/${exampleWeather}
+
mkdir ${zipDir}/${tmpDir}/build
+mkdir ${zipDir}/${tmpDir}/build/examples
#=====================#
# Prepare BINARY ZIP. #
#=====================#
+cpSrc() {
+ rsync -avzq "$1"/src ${zipDir}/${tmpDir}/"$1" --exclude '**/.DS_Store'
--exclude '**/*.iml'
+}
+
rsync -avzq bin ${zipDir}/${tmpDir} --exclude '**/.DS_Store' --exclude
bin/prepare.sh --exclude bin/MAVEN-RELEASE.md
rsync -avzq openapi ${zipDir}/${tmpDir} --exclude '**/.DS_Store'
-rsync -avzq ${coreModule}/src ${zipDir}/${tmpDir}/${coreModule} --exclude
'**/.DS_Store' --exclude '**/*.iml' --exclude '**/python/ctxword/data'
--exclude '**/server/geo/tools/**/*.txt'
-rsync -avzq ${stanfordModule}/src ${zipDir}/${tmpDir}/${stanfordModule}
--exclude '**/.DS_Store' --exclude '**/*.iml'
+
+cpSrc ${coreModule}
+cpSrc ${stanfordModule}
+cpSrc ${exampleAlarm}
+cpSrc ${exampleEcho}
+cpSrc ${exampleHelloworld}
+cpSrc ${exampleLightswitch}
+cpSrc ${exampleMinecraft}
+cpSrc ${exampleMinecraftMod}
+cpSrc ${examplePhone}
+cpSrc ${exampleSql}
+cpSrc ${exampleTime}
+cpSrc ${exampleWeather}
rsync -avzq sql ${zipDir}/${tmpDir} --exclude '**/.DS_Store'
+cpConf() {
+ cp "$1"/src/main/resources/nlpcraft.conf
${zipDir}/${tmpDir}/build/examples/"$(echo "$1" | tr '/' '-')".conf
+}
+
cp bindist/LICENSE ${zipDir}/${tmpDir}
cp bindist/NOTICE ${zipDir}/${tmpDir}
cp DISCLAIMER ${zipDir}/${tmpDir}
cp ${coreModule}/src/main/resources/nlpcraft.conf ${zipDir}/${tmpDir}/build
+
+cpConf ${exampleAlarm}
+cpConf ${exampleEcho}
+cpConf ${exampleHelloworld}
+cpConf ${exampleLightswitch}
+cpConf ${exampleMinecraft}
+cpConf ${examplePhone}
+cpConf ${exampleSql}
+cpConf ${exampleTime}
+cpConf ${exampleWeather}
+
cp ${coreModule}/src/main/resources/ignite.xml ${zipDir}/${tmpDir}/build
cp ${coreModule}/src/main/resources/log4j2.xml ${zipDir}/${tmpDir}/build
rsync -avzq ${coreModule}/target/*all-deps.jar ${zipDir}/${tmpDir}/build
rsync -avzq ${coreModule}/target/apidocs/** ${zipDir}/${tmpDir}/javadoc
--exclude '**/.DS_Store'
-rsync -avzq ${stanfordModule}/target/*.jar ${zipDir}/${tmpDir}/build --exclude
'*-sources.jar'
+
+cpJar() {
+ rsync -avzq "$1"/target/*.jar ${zipDir}/${tmpDir}/build --exclude
'*-sources.jar'
+}
+
+cpJarExamples() {
+ rsync -avzq "$1"/target/*.jar ${zipDir}/${tmpDir}/build/examples --exclude
'*-sources.jar'
+}
+
+cpJar ${stanfordModule}
+cpJarExamples ${exampleAlarm}
+cpJarExamples ${exampleEcho}
+cpJarExamples ${exampleHelloworld}
+cpJarExamples ${exampleLightswitch}
+cpJarExamples ${exampleMinecraft}
+rsync -avzq ${exampleMinecraftMod}/build/libs/*.jar
${zipDir}/${tmpDir}/build/examples --exclude '*-sources.jar'
+cpJarExamples ${examplePhone}
+cpJarExamples ${exampleSql}
+cpJarExamples ${exampleTime}
+cpJarExamples ${exampleWeather}
# Prepares bin zip.
cd ${zipDir} || exit
@@ -84,8 +162,26 @@ rm -R ${tmpDir}/javadoc 2> /dev/null
cd ../
mkdir ${zipDir}/${tmpDir}/javadoc
-cp ${coreModule}/pom.xml ${zipDir}/${tmpDir}/${coreModule}
-cp ${stanfordModule}/pom.xml ${zipDir}/${tmpDir}/${stanfordModule}
+cpPom() {
+ cp "$1"/pom.xml ${zipDir}/${tmpDir}/"$1"
+}
+
+cpPom ${coreModule}
+cpPom ${stanfordModule}
+cpPom ${exampleAlarm}
+cpPom ${exampleEcho}
+cpPom ${exampleHelloworld}
+cpPom ${exampleLightswitch}
+cpPom ${exampleMinecraft}
+cpPom ${examplePhone}
+cpPom ${exampleSql}
+cpPom ${exampleTime}
+cpPom ${exampleWeather}
+
+cp ${exampleMinecraftMod}/build.gradle
${zipDir}/${tmpDir}/${exampleMinecraftMod}
+cp ${exampleMinecraftMod}/gradlew ${zipDir}/${tmpDir}/${exampleMinecraftMod}
+cp ${exampleMinecraftMod}/gradlew.bat
${zipDir}/${tmpDir}/${exampleMinecraftMod}
+
cp pom.xml ${zipDir}/${tmpDir}
cp LICENSE ${zipDir}/${tmpDir}
cp NOTICE ${zipDir}/${tmpDir}
@@ -113,4 +209,4 @@ cd "${curDir}" || exit
echo
echo "****************************"
echo "ZIPs are prepared in folder: '${zipDir}'"
-echo "****************************"
+echo "****************************"
\ No newline at end of file
diff --git a/nlpcraft-examples/minecraft-mod/.gitignore
b/nlpcraft-examples/minecraft-mod/.gitignore
index b6f374b..6bda385 100644
--- a/nlpcraft-examples/minecraft-mod/.gitignore
+++ b/nlpcraft-examples/minecraft-mod/.gitignore
@@ -1,3 +1,4 @@
logs
.gradle
+gradle
build
\ No newline at end of file
diff --git a/nlpcraft-examples/minecraft-mod/build.gradle
b/nlpcraft-examples/minecraft-mod/build.gradle
index a38d331..afebd7c 100644
--- a/nlpcraft-examples/minecraft-mod/build.gradle
+++ b/nlpcraft-examples/minecraft-mod/build.gradle
@@ -74,14 +74,14 @@ jar {
task dumpBlocks(type: JavaExec) {
description = 'Dumps game file objects. Supports 2 types: items and blocks'
classpath sourceSets.main.runtimeClasspath
- main = "org.apache.nlpcraft.example.minecraft.GameFilesDump"
+ main = "org.apache.nlpcraft.example.minecraft.utils.GameFilesDump"
args "block", minecraftVersion
}
task dumpItems(type: JavaExec) {
description = 'Dumps game file objects. Supports 2 types: items and blocks'
classpath sourceSets.main.runtimeClasspath
- main = "org.apache.nlpcraft.example.minecraft.GameFilesDump"
+ main = "org.apache.nlpcraft.example.minecraft.utils.GameFilesDump"
args "block", minecraftVersion
}
diff --git a/nlpcraft-examples/minecraft-mod/gradle/wrapper/gradle-wrapper.jar
b/nlpcraft-examples/minecraft-mod/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 7a3265e..0000000
Binary files
a/nlpcraft-examples/minecraft-mod/gradle/wrapper/gradle-wrapper.jar and
/dev/null differ
diff --git
a/nlpcraft-examples/minecraft-mod/gradle/wrapper/gradle-wrapper.properties
b/nlpcraft-examples/minecraft-mod/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 1d5b29f..0000000
--- a/nlpcraft-examples/minecraft-mod/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip