Browse Source

Fix to remove extra semicolon on the macro call.

Yao Wei Tjong 姚伟忠 4 years ago
parent
commit
eba3e7c91b

+ 2 - 5
rakefile

@@ -724,12 +724,9 @@ def urho_app_cpp(name)
   <<-EOF
 #include "#{name}.h"
 
-URHO3D_DEFINE_APPLICATION_MAIN(#{name});
+URHO3D_DEFINE_APPLICATION_MAIN(#{name})
 
-#{name}::#{name}(Context* context)
-    : Application(context)
-{
-}
+#{name}::#{name}(Context* context) : Application(context) {}
 
 void #{name}::Start()
 {

+ 74 - 0
website/docs/getting-started/create-urhoapp.mdx

@@ -145,6 +145,8 @@ build/linux/bin/UrhoApp
 
 For Android platform, you would have to use other gradle task (e.g., `installDebug`) to deploy the UrhoApp to an Android Emulator or actual device.
 
+![UrhoApp screenshot on Android platform](/img/docs/urhoapp-android-screenshot.png)
+
 ### Using IDE {#build-urhoapp-project-using-ide}
 
 Similar to Urho3D project, the UrhoApp project can be opened directly in the IDE that supports CMake or Gradle build system or by opening the generated project file in the build tree.
@@ -184,6 +186,12 @@ Do not update the Android Gradle Plugin when being prompted, unless you know wha
 
 <div className={clsx('textBlock', styles.fixedHeight)}>
 
+:::caution
+
+Disable the Gradle plugin and Gradle Native plugin as they may interfere and prevent proper project setup.
+
+:::
+
 - Choose "Open" to open the new project.
 - In the "Open Project Wizard" or in the "CMake Settings", set the `URHO3D_HOME` accordingly in the "CMake options" field, e.g.:
   - `~/.urho3d/install/linux` when targeting Linux platform with GCC
@@ -264,3 +272,69 @@ Do not update the Android Gradle Plugin when being prompted, unless you know wha
 
   </TabItem>
 </Tabs>
+
+## Project Structure
+
+In order to reuse the same build system for Urho3D project to successfully build your own UrhoApp project, the UrhoApp project must be structured similarly to Urho3D project. Assuming you chose to use the `rake new` to create the UrhoApp project, you will have the following project structure under a new app directory:
+
+```
+UrhoApp
+├─ app
+│  ├─ build.gradle.kts
+│  ├─ CMakeLists.txt
+│  ├─ proguard-rules.pro
+│  └─ src
+│     ├─ cpp
+│     │  ├─ UrhoApp.cpp
+│     │  └─ UrhoApp.h
+│     ├─ java
+│     │  └─ io/urho3d/urhoapp
+│     │     └─ MainActivity.kt
+│     ├─ res
+│     |  └─ (truncated)
+│     └─ AndroidManifest.xml
+├─ bin
+│  ├─ CoreData
+│  │  └─ (as in Urho3D)
+│  └─ Data
+│     ├─ Materials
+│     │  └─ Mushroom.xml
+│     ├─ Models
+│     │  └─ Mushroom.mdl
+│     ├─ Music
+│     │  └─ Ninja Gods.ogg
+│     └─ Textures
+│        ├─ Mushroom.dds
+│        ├─ UrhoIcon.icns
+│        └─ UrhoIcon.png
+├─ build.gradle.kts
+├─ cmake
+│  └─ (as in Urho3D)
+├─ CMakeLists.txt
+├─ gradle/wrapper
+│  ├─ gradle-wrapper.jar
+│  └─ gradle-wrapper.properties
+├─ gradle.properties
+├─ gradlew
+├─ gradlew.bat
+├─ rakefile
+├─ scripts
+│  └─ (as in Urho3D)
+├─ settings.gradle.kts
+├─ .clang-format
+├─ .clang-tidy
+├─ .gitattributes
+└─ .gitignore
+```
+
+At the root of the project there are a few build scripts which can be grouped as follows:
+- **CMake** - consist of `CMakeLists.txt` and all the CMake modules and toolchains in the `cmake/` directory.
+- **Gradle** - consist of `build.gradle.kts`, `settings.gradle.kts`, `gradle.properties`, and the Gradle wrapper scripts.
+- **Shell** - consist of convenience *nix bash shell script and Windows batch files in the `script/` directory.
+- **Rake** - one `rakefile` that defines all the common tasks with opinionated default options.
+
+If you are very familiar with CMake then you can directly invoke `cmake`, `ccmake`, or `cmake-gui` to generate a build tree for all the supported platforms, except for Android platform. For the latter case you need to use `gradle`, or via its wrapper script if you don't have Gradle installed globally. For the most cases though, you will probably find it useful to use the convenience shell scripts or to use them as reference for your own convenience scripts. Finally, the `rake` command can be used to execute rake tasks for building the project and more.
+
+All the above are for the build system, the actual meat of the UrhoApp project are only residing in the following two directories:
+- `app/` - mainly contains the C++ source code in `src/cpp/` and Kotlin/Java source code in `src/java/`.
+- `bin/` - contains the assets used by the Urho3D game engine, at the very least it should have `CoreData/` and `Data/`.

+ 2 - 2
website/docs/getting-started/getting-started.module.scss

@@ -18,11 +18,11 @@ div {
     }
 
     .ideInstall + & {
-      min-height: 332px;
+      min-height: 412px;
     }
 
     .ideUrhoApp + & {
-      min-height: 302px;
+      min-height: 356px;
     }
   }
 }

+ 7 - 1
website/docs/getting-started/installation.mdx

@@ -289,7 +289,7 @@ set "PLATFORM=web" && rake build install
 # When compiling natively using VS, "PLATFORM=win" is the default on Windows
 rake build install
 
-# When compiling natively using MinGW-w64, always install to system-wide location with potential clash
+# When compiling natively using MinGW-w64
 set "GENERATOR=mingw" && rake build install
 
 # When cross-compiling on Linux host machine, substitute '?' accordingly
@@ -339,6 +339,12 @@ Do not update the Android Gradle Plugin when being prompted, unless you know wha
 
 <div className={clsx('textBlock', styles.fixedHeight)}>
 
+:::caution
+
+Disable the Gradle plugin and Gradle Native plugin as they may interfere and prevent proper project setup.
+
+:::
+
 - Choose "Open" or "Get from VCS" if you haven't cloned the Urho3D project yet.
 - In the "Open Project Wizard" or in the "CMake Settings", set the `CMAKE_INSTALL_PREFIX` accordingly in the "CMake options" field, e.g.:
   - `~/.urho3d/install/linux` when targeting Linux platform with GCC

+ 0 - 71
website/docs/getting-started/project-structure.mdx

@@ -1,71 +0,0 @@
----
-sidebar_position: 40
----
-
-# Project Structure
-
-The UrhoApp project is cross-platform out of the box!
-
-In order to reuse the same build system for Urho3D project to successfully build your own UrhoApp project, the UrhoApp project must be structured similarly to Urho3D project. Assuming you chose to use the `rake new` to create the UrhoApp project, you will have the following project structure under a new app directory:
-
-```
-UrhoApp
-├─ app
-│  ├─ build.gradle.kts
-│  ├─ CMakeLists.txt
-│  ├─ proguard-rules.pro
-│  └─ src
-│     ├─ cpp
-│     │  ├─ UrhoApp.cpp
-│     │  └─ UrhoApp.h
-│     ├─ java
-│     │  └─ io/urho3d/urhoapp
-│     │     └─ MainActivity.kt
-│     ├─ res
-│     |  └─ (truncated)
-│     └─ AndroidManifest.xml
-├─ bin
-│  ├─ CoreData
-│  │  └─ (as in Urho3D)
-│  └─ Data
-│     ├─ Materials
-│     │  └─ Mushroom.xml
-│     ├─ Models
-│     │  └─ Mushroom.mdl
-│     ├─ Music
-│     │  └─ Ninja Gods.ogg
-│     └─ Textures
-│        ├─ Mushroom.dds
-│        ├─ UrhoIcon.icns
-│        └─ UrhoIcon.png
-├─ build.gradle.kts
-├─ cmake
-│  └─ (as in Urho3D)
-├─ CMakeLists.txt
-├─ gradle/wrapper
-│  ├─ gradle-wrapper.jar
-│  └─ gradle-wrapper.properties
-├─ gradle.properties
-├─ gradlew
-├─ gradlew.bat
-├─ rakefile
-├─ scripts
-│  └─ (as in Urho3D)
-├─ settings.gradle.kts
-├─ .clang-format
-├─ .clang-tidy
-├─ .gitattributes
-└─ .gitignore
-```
-
-At the root of the project there are a few build scripts which can be grouped as follows:
-- **CMake** - consist of `CMakeLists.txt` and all the CMake modules and toolchains in the `cmake/` directory.
-- **Gradle** - consist of `build.gradle.kts`, `settings.gradle.kts`, `gradle.properties`, and the Gradle wrapper scripts.
-- **Shell** - consist of convenience *nix bash shell script and Windows batch files in the `script/` directory.
-- **Rake** - one `rakefile` that defines all the common tasks with opinionated default options.
-
-If you are very familiar with CMake then you can directly invoke `cmake`, `ccmake`, or `cmake-gui` to generate a build tree for all the supported platforms, except for Android platform. For the latter case you need to use `gradle`, or via its wrapper script if you don't have Gradle installed globally. For the most cases though, you will probably find it useful to use the convenience shell scripts or to use them as reference for your own convenience scripts. Finally, the `rake` command can be used to execute rake tasks for building the project and more.
-
-All the above are for the build system, the actual meat of the UrhoApp project are only residing in the following two directories:
-- `app/` - mainly contains the C++ source code in `src/cpp/` and Kotlin/Java source code in `src/java/`.
-- `bin/` - contains the assets used by the Urho3D game engine, at the very least it should have `CoreData/` and `Data/`.

+ 18 - 4
website/docs/getting-started/quick-start.mdx

@@ -235,20 +235,34 @@ alias dbe='script/dockerized.sh web'
 
 ### `dbe env`
 
-Output the preconfigured environment variables for the target platform and exit.
+Output the preconfigured environment variables for the target platform.
 
 ### `dbe ccache -s`
 
-Output the cache statistics from ccache and exit.
+Output the configuration and statistics from ccache.
 
 ### `dbe rake info['install_dir']`
 
-Output the Urho3D default install location for the target platform and exit.
+Output the Urho3D default install location for the target platform.
 
 ### `dbe ls $(dbe rake info['install_dir'])`
 
-List the current content of the Urho3D default install location for the target platform and exit.
+List the current content of the Urho3D default install location for the target platform.
 
 ### `dbe bash`
 
 Run an interactive `bash` shell where you can poke around inside the running docker container, execute any commands, including installing more software packages with `sudo` command for quick testing. Changes that are not in bind mount and docker volume will be lost after you type `exit`.
+
+## Build Artifacts
+
+The build artifacts from DBE can be found in the usual location as the conventional (non-dockerized) build environment. In fact the build artifacts from DBE should function and work as if they are built using the conventional way too. With the exception for Android platform, the build artifacts can be found in the build tree under the `bin/` directory.
+
+```bash
+ls $(dbe rake info['build_tree'])/bin
+```
+
+The build artifacts for Android platform in the AAR or in the APK format can be found in the `build/outputs/aar/` or `build/outputs/apk/` directory, respectively, relative to the Android library or Android app module.
+
+## Don't have docker engine?
+
+Fret not. The next section describes how to prepare the build environment the conventional way for each target platform.