Separate folders for DevelopersGuide/FirstSteps
This patch creates separate folders for 3 different SDK examples in
DevelopersGuide/FirstSteps:
1. FirstUnoContact
2. FirstLoadComponent
3. HelloTextTableShape
Each one of these are ported to 4 languages: Java, C++, BASIC, Python.
The Java Makefile in the top folder is now separated into 3 different
Makefiles for Java programs.
Change-Id: Ifb2003be2aafb4caec4810eb21fbb4708b9a0628
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159591
Tested-by: Hossein <hossein@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
diff --git a/odk/CustomTarget_build-examples.mk b/odk/CustomTarget_build-examples.mk
index f536d83..d1810e2 100644
--- a/odk/CustomTarget_build-examples.mk
+++ b/odk/CustomTarget_build-examples.mk
@@ -10,7 +10,7 @@
my_example_dirs = \
CLI/CSharp/Spreadsheet \
CLI/VB.NET/WriterDemo \
DevelopersGuide/FirstSteps/cxx \
DevelopersGuide/FirstSteps/FirstUnoContact/cxx \
DevelopersGuide/BasicAndDialogs/ToolkitControls \
DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp \
DevelopersGuide/Components/CppComponent \
diff --git a/odk/CustomTarget_build-examples_java.mk b/odk/CustomTarget_build-examples_java.mk
index f494296..213aa35 100644
--- a/odk/CustomTarget_build-examples_java.mk
+++ b/odk/CustomTarget_build-examples_java.mk
@@ -19,7 +19,9 @@ my_example_dirs_java = \
DevelopersGuide/Config \
DevelopersGuide/Database \
DevelopersGuide/Drawing \
DevelopersGuide/FirstSteps \
DevelopersGuide/FirstSteps/FirstUnoContact/java \
DevelopersGuide/FirstSteps/FirstLoadComponent/java \
DevelopersGuide/FirstSteps/HelloTextTableShape/java \
DevelopersGuide/Forms \
DevelopersGuide/GUI \
DevelopersGuide/OfficeBean \
diff --git a/odk/Package_examples.mk b/odk/Package_examples.mk
index f533a91..9e5bc65 100644
--- a/odk/Package_examples.mk
+++ b/odk/Package_examples.mk
@@ -19,8 +19,6 @@ $(eval $(call gb_Package_add_files_with_dir,odk_examples,$(SDKDIRNAME)/examples,
CLI/CSharp/Spreadsheet/ViewSample.cs \
CLI/VB.NET/WriterDemo/Makefile \
CLI/VB.NET/WriterDemo/WriterDemo.vb \
DevelopersGuide/FirstSteps/cxx/FirstUnoContact.cxx \
DevelopersGuide/FirstSteps/cxx/Makefile \
DevelopersGuide/BasicAndDialogs/CreatingDialogs/CreatingDialogs.odt \
DevelopersGuide/BasicAndDialogs/CreatingDialogs/Makefile \
DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.java \
@@ -173,11 +171,21 @@ $(eval $(call gb_Package_add_files_with_dir,odk_examples,$(SDKDIRNAME)/examples,
DevelopersGuide/Extensions/DialogWithHelp/help/en/com.foocorp.foo-ext/page1.xhp \
DevelopersGuide/Extensions/DialogWithHelp/help/en/com.foocorp.foo-ext/page2.xhp \
DevelopersGuide/Extensions/DialogWithHelp/help/en/com.foocorp.foo-ext/subfolder/anotherpage.xhp \
DevelopersGuide/FirstSteps/FirstLoadComponent.java \
DevelopersGuide/FirstSteps/FirstUnoContact.java \
DevelopersGuide/FirstSteps/HelloTextTableShape.java \
DevelopersGuide/FirstSteps/Makefile \
DevelopersGuide/FirstSteps/build_FirstUnoContact.xml \
DevelopersGuide/FirstSteps/FirstUnoContact/cxx/FirstUnoContact.cxx \
DevelopersGuide/FirstSteps/FirstUnoContact/cxx/Makefile \
DevelopersGuide/FirstSteps/FirstUnoContact/java/FirstUnoContact.java \
DevelopersGuide/FirstSteps/FirstUnoContact/java/Makefile \
DevelopersGuide/FirstSteps/FirstUnoContact/java/build.xml \
DevelopersGuide/FirstSteps/FirstUnoContact/basic/FirstUnoContact.bas \
DevelopersGuide/FirstSteps/FirstUnoContact/python/FirstUnoContact.py \
DevelopersGuide/FirstSteps/FirstLoadComponent/java/FirstLoadComponent.java \
DevelopersGuide/FirstSteps/FirstLoadComponent/java/Makefile \
DevelopersGuide/FirstSteps/FirstLoadComponent/basic/FirstLoadComponent.bas \
DevelopersGuide/FirstSteps/FirstLoadComponent/python/FirstLoadComponent.py \
DevelopersGuide/FirstSteps/HelloTextTableShape/java/HelloTextTableShape.java \
DevelopersGuide/FirstSteps/HelloTextTableShape/java/Makefile \
DevelopersGuide/FirstSteps/HelloTextTableShape/basic/HelloTextTableShape.bas \
DevelopersGuide/FirstSteps/HelloTextTableShape/python/HelloTextTableShape.py \
DevelopersGuide/Forms/BooleanValidator.java \
DevelopersGuide/Forms/ButtonOperator.java \
DevelopersGuide/Forms/ComponentTreeTraversal.java \
diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.bas b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/basic/FirstLoadComponent.bas
similarity index 100%
rename from odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.bas
rename to odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/basic/FirstLoadComponent.bas
diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.java b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/java/FirstLoadComponent.java
similarity index 100%
rename from odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.java
rename to odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/java/FirstLoadComponent.java
diff --git a/odk/examples/DevelopersGuide/FirstSteps/Makefile b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/java/Makefile
similarity index 81%
copy from odk/examples/DevelopersGuide/FirstSteps/Makefile
copy to odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/java/Makefile
index 53077d0..94f2332 100644
--- a/odk/examples/DevelopersGuide/FirstSteps/Makefile
+++ b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/java/Makefile
@@ -34,22 +34,18 @@
# Builds the FirstSteps examples of the Developers Guide.
PRJ=../../..
PRJ=../../../../..
SETTINGS=$(PRJ)/settings
include $(SETTINGS)/settings.mk
include $(SETTINGS)/std.mk
# Define non-platform/compiler specific settings
EXAMPLE_NAME=FirstStepsExamples
EXAMPLE_NAME=FirstLoadComponent
OUT_APP_CLASS = $(OUT_CLASS)/$(EXAMPLE_NAME)
APP1_NAME=FirstUnoContact
APP1_JAR=$(OUT_APP_CLASS)/$(APP1_NAME).jar
APP2_NAME=FirstLoadComponent
APP2_JAR=$(OUT_APP_CLASS)/$(APP2_NAME).jar
APP3_NAME=HelloTextTableShape
APP3_JAR=$(OUT_APP_CLASS)/$(APP3_NAME).jar
APP_NAME=FirstLoadComponent
APP_JAR=$(OUT_APP_CLASS)/$(APP_NAME).jar
SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
$(PATH_SEPARATOR)$(OUT_APP_CLASS))
@@ -79,17 +75,13 @@ $(OUT_APP_CLASS)/%.jar : $(OUT_APP_CLASS)/%.mf $(OUT_APP_CLASS)/%.class
+cd $(subst /,$(PS),$(OUT_APP_CLASS)) && $(SDK_JAR) cvfm $(@F) $*.mf $*.class
+$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
$(APP1_JAR) : $(OUT_APP_CLASS)/$(APP1_NAME).mf $(OUT_APP_CLASS)/$(APP1_NAME).class
$(APP2_JAR) : $(OUT_APP_CLASS)/$(APP2_NAME).mf $(OUT_APP_CLASS)/$(APP2_NAME).class
$(APP3_JAR) : $(OUT_APP_CLASS)/$(APP3_NAME).mf $(OUT_APP_CLASS)/$(APP3_NAME).class
$(APP_JAR) : $(OUT_APP_CLASS)/$(APP_NAME).mf $(OUT_APP_CLASS)/$(APP_NAME).class
$(EXAMPLE_NAME) : $(APP1_JAR) $(APP2_JAR) $(APP3_JAR)
$(EXAMPLE_NAME) : $(APP_JAR)
@echo --------------------------------------------------------------------------------
@echo Please use one of the following commands to execute the examples!
@echo Please use the following command to execute the example!
@echo -
@echo $(MAKE) $(APP1_NAME).run
@echo $(MAKE) $(APP2_NAME).run
@echo $(MAKE) $(APP3_NAME).run
@echo $(MAKE) -f Example_Java.mk $(APP_NAME).run
@echo --------------------------------------------------------------------------------
%.run: $(OUT_APP_CLASS)/%.jar
diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.py b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/python/FirstLoadComponent.py
similarity index 100%
rename from odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.py
rename to odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/python/FirstLoadComponent.py
diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.bas b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/basic/FirstUnoContact.bas
similarity index 100%
rename from odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.bas
rename to odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/basic/FirstUnoContact.bas
diff --git a/odk/examples/DevelopersGuide/FirstSteps/cxx/FirstUnoContact.cxx b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/cxx/FirstUnoContact.cxx
similarity index 100%
rename from odk/examples/DevelopersGuide/FirstSteps/cxx/FirstUnoContact.cxx
rename to odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/cxx/FirstUnoContact.cxx
diff --git a/odk/examples/DevelopersGuide/FirstSteps/cxx/Makefile b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/cxx/Makefile
similarity index 99%
rename from odk/examples/DevelopersGuide/FirstSteps/cxx/Makefile
rename to odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/cxx/Makefile
index 0ba2928..dca5fa9 100644
--- a/odk/examples/DevelopersGuide/FirstSteps/cxx/Makefile
+++ b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/cxx/Makefile
@@ -34,7 +34,7 @@
# Builds the FirstUnoContact example of the SDK.
PRJ=../../../..
PRJ=../../../../..
SETTINGS=$(PRJ)/settings
include $(SETTINGS)/settings.mk
diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.java b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/java/FirstUnoContact.java
similarity index 100%
rename from odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.java
rename to odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/java/FirstUnoContact.java
diff --git a/odk/examples/DevelopersGuide/FirstSteps/Makefile b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/java/Makefile
similarity index 81%
rename from odk/examples/DevelopersGuide/FirstSteps/Makefile
rename to odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/java/Makefile
index 53077d0..4dca446 100644
--- a/odk/examples/DevelopersGuide/FirstSteps/Makefile
+++ b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/java/Makefile
@@ -34,22 +34,18 @@
# Builds the FirstSteps examples of the Developers Guide.
PRJ=../../..
PRJ=../../../../..
SETTINGS=$(PRJ)/settings
include $(SETTINGS)/settings.mk
include $(SETTINGS)/std.mk
# Define non-platform/compiler specific settings
EXAMPLE_NAME=FirstStepsExamples
EXAMPLE_NAME=FirstUnoContact
OUT_APP_CLASS = $(OUT_CLASS)/$(EXAMPLE_NAME)
APP1_NAME=FirstUnoContact
APP1_JAR=$(OUT_APP_CLASS)/$(APP1_NAME).jar
APP2_NAME=FirstLoadComponent
APP2_JAR=$(OUT_APP_CLASS)/$(APP2_NAME).jar
APP3_NAME=HelloTextTableShape
APP3_JAR=$(OUT_APP_CLASS)/$(APP3_NAME).jar
APP_NAME=FirstUnoContact
APP_JAR=$(OUT_APP_CLASS)/$(APP_NAME).jar
SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
$(PATH_SEPARATOR)$(OUT_APP_CLASS))
@@ -79,17 +75,13 @@ $(OUT_APP_CLASS)/%.jar : $(OUT_APP_CLASS)/%.mf $(OUT_APP_CLASS)/%.class
+cd $(subst /,$(PS),$(OUT_APP_CLASS)) && $(SDK_JAR) cvfm $(@F) $*.mf $*.class
+$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
$(APP1_JAR) : $(OUT_APP_CLASS)/$(APP1_NAME).mf $(OUT_APP_CLASS)/$(APP1_NAME).class
$(APP2_JAR) : $(OUT_APP_CLASS)/$(APP2_NAME).mf $(OUT_APP_CLASS)/$(APP2_NAME).class
$(APP3_JAR) : $(OUT_APP_CLASS)/$(APP3_NAME).mf $(OUT_APP_CLASS)/$(APP3_NAME).class
$(APP_JAR) : $(OUT_APP_CLASS)/$(APP_NAME).mf $(OUT_APP_CLASS)/$(APP_NAME).class
$(EXAMPLE_NAME) : $(APP1_JAR) $(APP2_JAR) $(APP3_JAR)
$(EXAMPLE_NAME) : $(APP_JAR)
@echo --------------------------------------------------------------------------------
@echo Please use one of the following commands to execute the examples!
@echo Please use the following command to execute the example!
@echo -
@echo $(MAKE) $(APP1_NAME).run
@echo $(MAKE) $(APP2_NAME).run
@echo $(MAKE) $(APP3_NAME).run
@echo $(MAKE) -f Example_Java.mk $(APP_NAME).run
@echo --------------------------------------------------------------------------------
%.run: $(OUT_APP_CLASS)/%.jar
diff --git a/odk/examples/DevelopersGuide/FirstSteps/build_FirstUnoContact.xml b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/java/build.xml
similarity index 100%
rename from odk/examples/DevelopersGuide/FirstSteps/build_FirstUnoContact.xml
rename to odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/java/build.xml
diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.py b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/python/FirstUnoContact.py
similarity index 100%
rename from odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.py
rename to odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/python/FirstUnoContact.py
diff --git a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.bas b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/basic/HelloTextTableShape.bas
similarity index 100%
rename from odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.bas
rename to odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/basic/HelloTextTableShape.bas
diff --git a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/java/HelloTextTableShape.java
similarity index 100%
rename from odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java
rename to odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/java/HelloTextTableShape.java
diff --git a/odk/examples/DevelopersGuide/FirstSteps/Makefile b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/java/Makefile
similarity index 81%
copy from odk/examples/DevelopersGuide/FirstSteps/Makefile
copy to odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/java/Makefile
index 53077d0..a208b6e 100644
--- a/odk/examples/DevelopersGuide/FirstSteps/Makefile
+++ b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/java/Makefile
@@ -34,22 +34,18 @@
# Builds the FirstSteps examples of the Developers Guide.
PRJ=../../..
PRJ=../../../../..
SETTINGS=$(PRJ)/settings
include $(SETTINGS)/settings.mk
include $(SETTINGS)/std.mk
# Define non-platform/compiler specific settings
EXAMPLE_NAME=FirstStepsExamples
EXAMPLE_NAME=HelloTextTableShape
OUT_APP_CLASS = $(OUT_CLASS)/$(EXAMPLE_NAME)
APP1_NAME=FirstUnoContact
APP1_JAR=$(OUT_APP_CLASS)/$(APP1_NAME).jar
APP2_NAME=FirstLoadComponent
APP2_JAR=$(OUT_APP_CLASS)/$(APP2_NAME).jar
APP3_NAME=HelloTextTableShape
APP3_JAR=$(OUT_APP_CLASS)/$(APP3_NAME).jar
APP_NAME=HelloTextTableShape
APP_JAR=$(OUT_APP_CLASS)/$(APP_NAME).jar
SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
$(PATH_SEPARATOR)$(OUT_APP_CLASS))
@@ -79,17 +75,13 @@ $(OUT_APP_CLASS)/%.jar : $(OUT_APP_CLASS)/%.mf $(OUT_APP_CLASS)/%.class
+cd $(subst /,$(PS),$(OUT_APP_CLASS)) && $(SDK_JAR) cvfm $(@F) $*.mf $*.class
+$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
$(APP1_JAR) : $(OUT_APP_CLASS)/$(APP1_NAME).mf $(OUT_APP_CLASS)/$(APP1_NAME).class
$(APP2_JAR) : $(OUT_APP_CLASS)/$(APP2_NAME).mf $(OUT_APP_CLASS)/$(APP2_NAME).class
$(APP3_JAR) : $(OUT_APP_CLASS)/$(APP3_NAME).mf $(OUT_APP_CLASS)/$(APP3_NAME).class
$(APP_JAR) : $(OUT_APP_CLASS)/$(APP_NAME).mf $(OUT_APP_CLASS)/$(APP_NAME).class
$(EXAMPLE_NAME) : $(APP1_JAR) $(APP2_JAR) $(APP3_JAR)
$(EXAMPLE_NAME) : $(APP_JAR)
@echo --------------------------------------------------------------------------------
@echo Please use one of the following commands to execute the examples!
@echo Please use the following command to execute the example!
@echo -
@echo $(MAKE) $(APP1_NAME).run
@echo $(MAKE) $(APP2_NAME).run
@echo $(MAKE) $(APP3_NAME).run
@echo $(MAKE) -f Example_Java.mk $(APP_NAME).run
@echo --------------------------------------------------------------------------------
%.run: $(OUT_APP_CLASS)/%.jar
diff --git a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.py b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/python/HelloTextTableShape.py
similarity index 100%
rename from odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.py
rename to odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/python/HelloTextTableShape.py
diff --git a/odk/examples/DevelopersGuide/examples.html b/odk/examples/DevelopersGuide/examples.html
index df5a83f..7112439 100644
--- a/odk/examples/DevelopersGuide/examples.html
+++ b/odk/examples/DevelopersGuide/examples.html
@@ -224,8 +224,8 @@ examples</a></td>
<tr>
<td class="cell20"><img
src="../../docs/images/bluball.gif"/> <a
href="./FirstSteps/FirstUnoContact.java"
title="link to FirstSteps/FirstUnoContact.java">FirstUnoContact</a></td>
href="./FirstSteps/FirstUnoContact/java/FirstUnoContact.java"
title="link to FirstSteps/FirstUnoContact/java/FirstUnoContact.java">FirstUnoContact</a></td>
<td class="cell80">Shows how to initialize UNO and
get a remote office service manager from a running LibreOffice %PRODUCT_RELEASE% in a
different process space.</td>
@@ -233,16 +233,16 @@ different process space.</td>
<tr>
<td class="cell20"><img
src="../../docs/images/bluball.gif"/> <a
href="./FirstSteps/FirstLoadComponent.java"
title="link to FirstSteps/FirstLoadComponent.java">FirstLoadComponent</a></td>
href="./FirstSteps/FirstLoadComponent/java/FirstLoadComponent.java"
title="link to FirstSteps/FirstLoadComponent/java/FirstLoadComponent.java">FirstLoadComponent</a></td>
<td class="cell80">Demonstrates how to load a
component into LibreOffice %PRODUCT_RELEASE% by a Java application.</td>
</tr>
<tr>
<td class="cell20"><img
src="../../docs/images/bluball.gif"/> <a
href="./FirstSteps/HelloTextTableShape.java"
title="link to FirstSteps/HelloTextTableShape.java">HelloTextTableShape</a></td>
href="./FirstSteps/HelloTextTableShape/java/HelloTextTableShape.java"
title="link to FirstSteps/HelloTextTableShape/java/HelloTextTableShape.java">HelloTextTableShape</a></td>
<td class="cell80">Performs some generic text and
shape operations on a text document, a spreadsheet document and a
drawing document.</td>