@@ -2,12 +2,10 @@ import moxygen from "moxygen";
2
2
import assign from "object-assign" ;
3
3
import { program } from "commander" ;
4
4
import fs from "fs" ;
5
- import path from "path" ;
6
5
import doxygen from "doxygen" ;
7
6
8
7
const TEMPLATES_FOLDER = "./templates/cpp"
9
8
const XML_FOLDER = "./build/xml/"
10
- const SOURCE_SHADOW_FOLDER = "./source"
11
9
const PROGRAMMING_LANGUAGE = "cpp"
12
10
const DOXYGEN_FILE_PATH = "./doxygen.config"
13
11
const ACCESS_LEVEL = "public"
@@ -38,42 +36,6 @@ const cleanDirectory = (dir) => {
38
36
}
39
37
}
40
38
41
- const findAllFiles = ( dir , fileExtensions , include , exclude ) => {
42
- const files = fs . readdirSync ( dir )
43
- let result = [ ]
44
- files . forEach ( file => {
45
- const path = dir + "/" + file
46
- const stat = fs . statSync ( path )
47
- if ( stat && stat . isDirectory ( ) ) {
48
- result = result . concat ( findAllFilesRecursively ( path , include , exclude ) )
49
- } else {
50
- // Get file extension including the dot
51
- const fileExtension = file . substring ( file . lastIndexOf ( "." ) ) . toLowerCase ( )
52
-
53
- // Only consider files with the given extensions from the fileExtensions array
54
- if ( fileExtensions && ! fileExtensions . includes ( fileExtension ) ) {
55
- return
56
- }
57
-
58
- if ( include && ! file . match ( include ) ) {
59
- return
60
- }
61
- if ( exclude && file . match ( exclude ) ) {
62
- return
63
- }
64
- result . push ( path )
65
- }
66
- } )
67
- return result
68
- }
69
-
70
- const symlinkFilesTo = ( files , target , baseDirectory ) => {
71
- for ( const file of files ) {
72
- // The target path should be the base directory + the file path relative to the base directory
73
- const targetFile = target + "/" + path . relative ( baseDirectory , file )
74
- fs . symlinkSync ( file , targetFile )
75
- }
76
- }
77
39
78
40
// Get version from package.json without using require
79
41
const version = JSON . parse ( fs . readFileSync ( 'package.json' ) ) . version ;
@@ -106,11 +68,8 @@ if (includeCppFiles) {
106
68
fileExtensions . push ( ".cpp" )
107
69
}
108
70
109
- const files = findAllFiles ( sourceFolder , fileExtensions , commandOptions . include , commandOptions . exclude )
110
- cleanDirectory ( SOURCE_SHADOW_FOLDER )
111
71
cleanDirectory ( "./build" )
112
- createDirectories ( [ SOURCE_SHADOW_FOLDER , "./build/md" ] )
113
- symlinkFilesTo ( files , SOURCE_SHADOW_FOLDER , sourceFolder )
72
+ createDirectories ( [ "./build/md" ] )
114
73
115
74
if ( ! doxygen . isDoxygenExecutableInstalled ( ) ) {
116
75
console . log ( "Doxygen is not installed. Downloading Doxygen..." )
@@ -123,7 +82,7 @@ if(!doxygen.isDoxygenExecutableInstalled()) {
123
82
124
83
// Create doxygen config file. XML output is required for moxygen
125
84
const doxyFileOptions = {
126
- INPUT : SOURCE_SHADOW_FOLDER ,
85
+ INPUT : sourceFolder ,
127
86
RECURSIVE : "YES" ,
128
87
GENERATE_HTML : "NO" ,
129
88
GENERATE_LATEX : "NO" ,
0 commit comments