blob: ed47b4417aaeae053a9257faf0ad452c214b925e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
import static org.apache.tools.ant.taskdefs.condition.Os.*
plugins {
id "c"
id "de.protos.source-publish"
}
apply from: "$rootDir/gradle/publish.gradle"
def platform = 'UNKNOWN'
if(isFamily(FAMILY_WINDOWS)) { platform = 'MT_WIN_MinGW' }
else if(isFamily(FAMILY_UNIX)) { platform = 'MT_POSIX_GENERIC_GCC' }
model {
components {
etrice_runtime_c(NativeLibrarySpec) {
sources.c {
source {
srcDirs = ['src/common', 'src/config', "src/platforms/$platform", 'src/util']
include '**/*.c'
}
exportedHeaders {
srcDirs = ['src/common', 'src/config', "src/platforms/$platform", 'src/util']
}
}
binaries {
withType(SharedLibraryBinarySpec) { buildable = false }
all {
def std99 = (platform == 'MT_WIN_MinGW') ? '-std=c99' : '-std=gnu99' // others platform are not strict ansi
cCompiler.args '-g3', std99
}
}
}
}
}
zipSource {
from('src/common', 'src/config', 'src/util')
}
publishing {
publications {
etrice(MavenPublication) {
from components.adhoc
}
}
repositories publishRepos
}
// Configure publishing of platforms
subprojects {
buildDir = parent.layout.buildDirectory.dir("platforms/${project.name}")
apply plugin: 'de.protos.source-publish'
apply from: "$rootDir/gradle/publish.gradle"
zipSource {
from layout.projectDirectory
exclude '*Examples/'
}
publishing {
publications {
etrice(MavenPublication) {
artifactId = "${parent.project.name}.${project.name}"
from components.adhoc
}
}
repositories publishRepos
}
}
|