mirror of
https://github.com/ysoftdevs/gradle-training.git
synced 2026-01-19 01:57:10 +01:00
add c language Visual Studio example
This commit is contained in:
18
08-c-visual-studio/build.gradle
Normal file
18
08-c-visual-studio/build.gradle
Normal file
@@ -0,0 +1,18 @@
|
||||
apply plugin: 'c'
|
||||
apply plugin: 'visual-studio'
|
||||
|
||||
sources {
|
||||
main {
|
||||
c {
|
||||
source {
|
||||
// Include just source, avoid including *.swp and other helper files
|
||||
include "**/*.c"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
executables {
|
||||
main {
|
||||
}
|
||||
}
|
||||
6
08-c-visual-studio/src/main/c/main.c
Normal file
6
08-c-visual-studio/src/main/c/main.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
printf("Making the MFPs think\n");
|
||||
return 0;
|
||||
}
|
||||
11
README.md
11
README.md
@@ -84,3 +84,14 @@ Gradle automatically detects toolchain e.g. Visual Studio or GCC.
|
||||
gradle mainExecutable
|
||||
|
||||
Binary is stored in build/binaries/mainExecutable
|
||||
|
||||
|
||||
08-c-visual-studio
|
||||
------------------
|
||||
|
||||
Gradle is able to generate project files for Visual Studio for C/C++.
|
||||
|
||||
gradle mainVisualStudio
|
||||
ii .\visualStudio\mainExe.sln
|
||||
|
||||
Solution file is stored in visualStudio/mainExe.sln
|
||||
|
||||
Reference in New Issue
Block a user