Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: ced714fd395794a847045eae34a31f95216f1207 (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
73
74
plugins {
	id "c"
	id "de.protos.etrice-c"
	id "de.protos.source-publish"
}

apply from: "$rootDir/gradle/publish.gradle"

dependencies {
	generator project(':plugins:org.eclipse.etrice.generator.c')
}

modelSet {
	room {
		option 'msc_instr'
	}
}

model {
	components {
		etrice_modellib_c(NativeLibrarySpec) {
			sources.c {
				builtBy generateRoom
				source {
					srcDirs = [modelSet.room.genDir]
					include '**/*.c'
				}
				exportedHeaders {
					srcDirs = [modelSet.room.genDir]
				}
				lib project: ':runtime:org.eclipse.etrice.runtime.c', library: 'etrice_runtime_c', linkage: 'api'
			}
			binaries {
				withType(SharedLibraryBinarySpec) { buildable = false }
				all { cCompiler.args '-g3', '-std=c99' }
			}
		}
	}
}

task syncGenDir(type: Sync, dependsOn: generate) {
	from modelSet.room.genDir
	into 'src-gen'
}

task zipModellib(type: Zip, dependsOn: syncGenDir) {
	archiveBaseName = project.name
	archiveVersion = project.version
	destinationDirectory = layout.buildDirectory
	from('model') {
		exclude '**/diagrams/'
	}
	from(projectDir) {
		include 'src-gen/**'
	}
	includeEmptyDirs false
}
build.dependsOn zipModellib

zipSource {
	from(modelSet.room.genDir) {
		into 'src'
	}
}

publishing {
    publications {
        etrice(MavenPublication) {
        	from components.adhoc
            artifact zipModellib
        }
    }
	repositories publishRepos
}

Back to the top