-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdoxygen-init.groovy
62 lines (59 loc) · 1.84 KB
/
doxygen-init.groovy
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
import org.gradle.api.Project
//Doxygen task
rootProject {
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.ysb33r.gradle:doxygen:0.2'
}
}
}
projectsEvaluated {
ext.applyDoxygen = {
addDoxygenTask project
}
if (rootProject.subprojects.isEmpty()) {
rootProject applyDoxygen
} else {
rootProject.subprojects applyDoxygen
}
}
void addDoxygenTask(final Project project) {
final File TEMPLATE = findConfig()
if (project.hasProperty('android')) {
project.apply plugin:'org.ysb33r.doxygen'
project.tasks.doxygen {
if (TEMPLATE.exists()) {
template TEMPLATE.absolutePath
}
// dependsOn project.assembleDebug
group 'Documentation'
description 'Generates documentation using doxygen tool.'
dependsOn project.assembleRelease
project_number project.android.defaultConfig.versionName +
" (${project.android.defaultConfig.versionCode})"
// project_logo
output_directory project.docsDir
source = [project.android.sourceSets.main.java.srcDirs]
// source = [project.android.sourceSets.main.java.srcDirs,
// project.android.sourceSets.androidTest.java.srcDirs,
// project.android.sourceSets.test.java.srcDirs]
}
}
}
// Find default configuration.
File findConfig() {
final String CONFIG_NAME = 'Doxyfile'
File configFile = rootProject.file(CONFIG_NAME)
if (!configFile.exists()) {
for (final File dir : startParameter.initScripts) {
configFile = new File(dir.parentFile, CONFIG_NAME)
if (configFile.exists()) {
break
}
}
}
configFile
}