Tutorial by Examples: build

This is an example of a default build.gradle file in a module. apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion '25.0.3' signingConfigs { applicationName { keyAlias 'applicationName' keyPassword 'password...
Click the Run button in the toolbar (or press ⌘R) to build & run your project. Click Stop (or press ⌘.) to stop execution.   Click & hold to see the other actions, Test (⌘U), Profile (⌘I), and Analyze (⇧⌘B). Hold down modifier keys ⌥ option, ⇧ shift, and ⌃ control for more variants.  ...
project/jni/main.c #include <stdio.h> #include <unistd.h> int main(void) { printf("Hello world!\n"); return 0; } project/jni/Android.mk LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := hello_world LOCAL_SRC_FILES := main.c include $(BU...
The following is handy to have in build logs that identifies the build machine, and some parameters; simply make you main task depend on this task to print it before every build. <!-- Print Environment Info --> <target name="environment"> <!-- Get the current ti...
Many IDEs provide support for generating HTML from Javadocs automatically; some build tools (Maven and Gradle, for example) also have plugins that can handle the HTML creation. However, these tools are not required to generate the Javadoc HTML; this can be done using the command line javadoc tool. ...
CMake generates build environments for nearly any compiler or IDE from a single project definition. The following examples will demonstrate how to add a CMake file to the cross-platform "Hello World" C++ code. CMake files are always named "CMakeLists.txt" and should already exis...
Once you have a Dockerfile, you can build an image from it using docker build. The basic form of this command is: docker build -t image-name path If your Dockerfile isn't named Dockerfile, you can use the -f flag to give the name of the Dockerfile to build. docker build -t image-name -f Dockerfi...
BuildConfigField Gradle allows buildConfigField lines to define constants. These constants will be accessible at runtime as static fields of the BuildConfig class. This can be used to create flavors by defining all fields within the defaultConfig block, then overriding them for individual build fla...
The following examples show two main methods for installing Erlang/OTP on Ubuntu. Method 1 - Pre-built Binary Package Simply run this command and it will download and install the latest stable Erlang release from Erlang Solutions. $ sudo apt-get install erlang Method 2 - Build and Install from...
XML is made of basic building blocks, which are: element text attributes comments processing instructions An element has angle brackets: <element/> <element>some content</element> An attribute appears in an opening element tag: <element attribute-name="...
From your project directory, run the go build command and specify the operating system and architecture target with the GOOS and GOARCH environment variables: Compiling for Mac (64-bit): GOOS=darwin GOARCH=amd64 go build Compiling for Windows x86 processor: GOOS=windows GOARCH=386 go build ...
Debug cargo build Release Building with the --release flag enables certain compiler optimizations that aren't done when building a debug build. This makes the code run faster, but makes the compile time a bit longer too. For optimal performance, this command should be used once a release build ...
<PROJECT_ROOT>\app\build.gradle is specific for app module. <PROJECT_ROOT>\build.gradle is a "Top-level build file" where you can add configuration options common to all sub-projects/modules. If you use another module in your project, as a local library you would have another...
This example assumes you have already installed Java and Gradle. Use the following project structure: src/ main/ java/ com/ example/ Application.java build.gradle build.gradle is your build script for Gradle build system with the following content: buildscri...
String concatenation can be performed using the + operator. For example: String s1 = "a"; String s2 = "b"; String s3 = "c"; String s = s1 + s2 + s3; // abc Normally a compiler implementation will perform the above concatenation using methods involving a StringBui...
You can specify different application IDs or package names for each buildType or productFlavor using the applicationIdSuffix configuration attribute: Example of suffixing the applicationId for each buildType: defaultConfig { applicationId "com.package.android" minSdkVersion 17 ...
The StringBuffer, StringBuilder, Formatter and StringJoiner classes are Java SE utility classes that are primarily used for assembling strings from other information: The StringBuffer class has been present since Java 1.0, and provides a variety of methods for building and modifying a "buf...
public class Email { public string To { get; set; } public string From { get; set; } public string Subject { get; set; } public string Body { get; set; } } public class EmailBuilder { private readonly Email _email; public EmailBuilder() { _email = ...
The dexcount plugin counts methods and class resource count after a successful build. Add the plugin in the app/build.gradle: apply plugin: 'com.android.application' buildscript { repositories { mavenCentral() // or jcenter() } dependencies { classpath 'com.ge...
Simple example of how to create a custom plugin and DSL for your gradle project. This sample uses one of the three possible ways of creating plugins. The three ways are: inline buildSrc standalone plugins This example shows creating a plugin from the buildSrc folder. This sample will crea...

Page 1 of 11