diff --git a/.gitignore b/.gitignore index e43b0f9..8789cea 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ .DS_Store +.gradle +**/build/ diff --git a/README.md b/README.md index 508246c..59b09ba 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,22 @@ How to run: make ./helloworld +Gradle +------ + +Example of building C/C++ project by Gradle. +Gradle is using build.gradle file in main project directory. +Check out project layout. Source code is stored in src/main/cpp. +This is defined by convention and Gradle is able to use it, no further configuration is needed. +Gradle is able to determine compiler chain and use available compiler, e.g. g++ or Visual Studio. + +How to run (Linux): + + cd gradle/hellomuni + gradle mainExecutable + cd build/binaries/mainExecutable + ./hellomuni + Minunit testing --------------- diff --git a/gradle/hellomuni/build.gradle b/gradle/hellomuni/build.gradle new file mode 100644 index 0000000..0590df0 --- /dev/null +++ b/gradle/hellomuni/build.gradle @@ -0,0 +1 @@ +apply plugin: 'cpp-exe' diff --git a/gradle/hellomuni/src/main/cpp/hellomuni.cpp b/gradle/hellomuni/src/main/cpp/hellomuni.cpp new file mode 100644 index 0000000..76274b1 --- /dev/null +++ b/gradle/hellomuni/src/main/cpp/hellomuni.cpp @@ -0,0 +1,9 @@ +#include + +using namespace std; + +int main() { + cout << "Hello FI MUNI!" << endl; + return 0; +} +