ext { useJava = true useCpp = true baseId = 'datalog' groupId = 'org.wpilib.datalog' nativeName = 'datalog' devMain = 'org.wpilib.datalog.DevMain' } apply from: "${rootDir}/shared/jni/setupBuild.gradle" nativeUtils.exportsConfigs { datalog { } } model { components { all { it.sources.each { it.exportedHeaders { srcDirs 'src/main/native/include' } } } } } def examplesMap = [:]; file("$projectDir/examples").list(new FilenameFilter() { @Override public boolean accept(File current, String name) { return new File(current, name).isDirectory(); } }).each { examplesMap.put(it, []) } model { components { examplesMap.each { key, value -> "${key}"(NativeExecutableSpec) { targetBuildTypes 'debug' binaries.all { lib library: 'datalog', linkage: 'shared' lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared' } sources { cpp { source { srcDirs 'examples/' + "${key}" include '**/*.cpp' } } } } } } } sourceSets { printlog } task runPrintLog(type: JavaExec) { classpath = sourceSets.printlog.runtimeClasspath mainClass = 'printlog.PrintLog' } dependencies { api project(":wpiutil") printlogImplementation sourceSets.main.output }