mirror of
https://github.com/ysoftdevs/cpp-examples.git
synced 2026-03-06 08:00:14 +01:00
update definition of C++ gradle projects
This commit is contained in:
1
gradle-c-plugin/00-empty-project/build.gradle
Normal file
1
gradle-c-plugin/00-empty-project/build.gradle
Normal file
@@ -0,0 +1 @@
|
||||
// Empty one
|
||||
9
gradle-c-plugin/01-hello-task/build.gradle
Normal file
9
gradle-c-plugin/01-hello-task/build.gradle
Normal file
@@ -0,0 +1,9 @@
|
||||
task hello {
|
||||
// Loaded in configuration phase
|
||||
description = "Say Hello :-)"
|
||||
doLast {
|
||||
// Executed in execution phase
|
||||
println "Hello FI MUNI!"
|
||||
}
|
||||
}
|
||||
|
||||
2
gradle-c-plugin/02-c-plugin/build.gradle
Normal file
2
gradle-c-plugin/02-c-plugin/build.gradle
Normal file
@@ -0,0 +1,2 @@
|
||||
apply plugin: 'c'
|
||||
|
||||
7
gradle-c-plugin/03-executable/build.gradle
Normal file
7
gradle-c-plugin/03-executable/build.gradle
Normal file
@@ -0,0 +1,7 @@
|
||||
apply plugin: 'c'
|
||||
|
||||
executables {
|
||||
main {
|
||||
}
|
||||
}
|
||||
|
||||
6
gradle-c-plugin/03-executable/src/main/c/hello.c
Normal file
6
gradle-c-plugin/03-executable/src/main/c/hello.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv){
|
||||
printf("Hello FI MUNI!\n");
|
||||
return 0;
|
||||
}
|
||||
8
gradle-c-plugin/04-visual-studio/build.gradle
Normal file
8
gradle-c-plugin/04-visual-studio/build.gradle
Normal file
@@ -0,0 +1,8 @@
|
||||
apply plugin: 'c'
|
||||
apply plugin: 'visual-studio'
|
||||
|
||||
executables {
|
||||
main {
|
||||
}
|
||||
}
|
||||
|
||||
6
gradle-c-plugin/04-visual-studio/src/main/c/hello.c
Normal file
6
gradle-c-plugin/04-visual-studio/src/main/c/hello.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv){
|
||||
printf("Hello FI MUNI!\n");
|
||||
return 0;
|
||||
}
|
||||
45
gradle-c-plugin/05-debian-package/build.gradle
Normal file
45
gradle-c-plugin/05-debian-package/build.gradle
Normal file
@@ -0,0 +1,45 @@
|
||||
import org.gradle.api.publish.maven.MavenPublication
|
||||
buildscript {
|
||||
repositories {
|
||||
maven {
|
||||
url "http://dl.bintray.com/gesellix/gradle-plugins"
|
||||
}
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
}
|
||||
dependencies {
|
||||
classpath "de.gesellix:gradle-debian-plugin:12"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'pkg-debian'
|
||||
apply plugin: 'c'
|
||||
|
||||
version = "1.0.0"
|
||||
|
||||
executables {
|
||||
hello {
|
||||
}
|
||||
}
|
||||
|
||||
task prepare(type: Copy) {
|
||||
description "Copy files to Linux directory layout"
|
||||
from "build/binaries/helloExecutable"
|
||||
into "build/linux/usr/bin"
|
||||
}
|
||||
|
||||
debian {
|
||||
packagename = "hello-fimuni"
|
||||
publications = ['fimuni']
|
||||
controlDirectory = "$projectDir/src/main/resources/control"
|
||||
changelogFile = "$projectDir/src/main/resources/txt/changelog.txt"
|
||||
|
||||
data {
|
||||
def baseDir = "$buildDir/linux"
|
||||
dir {
|
||||
name = baseDir
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
7
gradle-c-plugin/05-debian-package/src/hello/c/hello.c
Normal file
7
gradle-c-plugin/05-debian-package/src/hello/c/hello.c
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv){
|
||||
printf("Hello FI MUNI!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/etc/default/hello-fimuni
|
||||
@@ -0,0 +1,11 @@
|
||||
Source: hello-fimuni
|
||||
Section: web
|
||||
Priority: optional
|
||||
Version: 1.0.0
|
||||
Maintainer: Juraj Michalek <juraj.michalek@ysoft.com>
|
||||
Homepage: http://www.ysoft.com/
|
||||
Package: hello-fimuni
|
||||
Architecture: all
|
||||
Depends:
|
||||
Description: Hello FI MUNI
|
||||
Example of Linux packaging for Gradle.
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Post installation script - executed at the last phase of installation
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Post remove script
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
# Pre-uninstallation script
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
Reference in New Issue
Block a user