@@ -168,41 +168,9 @@ tasks.withType<KorroTask> {
168168 dependsOn(copySamplesOutputs)
169169}
170170
171- // This task installs the pre-commit hook to the local machine the first time the project is built
172- // The pre-commit hook contains the command to run processKDocsMain before each commit
173- val installGitPreCommitHook by tasks.creating(Copy ::class ) {
174- doNotTrackState(/* reasonNotToTrackState = */ " Fails on TeamCity otherwise." )
175-
176- val gitHooksDir = File (rootProject.rootDir, " .git/hooks" )
177- if (gitHooksDir.exists()) {
178- from(File (rootProject.rootDir, " gradle/scripts/pre-commit" ))
179- into(gitHooksDir)
180- fileMode = 755
181-
182- // Workaround for https://github.com/Kotlin/dataframe/issues/612
183- if (OSType .identify() in listOf (OSType .Mac , OSType .Linux )) doLast {
184- exec {
185- workingDir(gitHooksDir)
186- commandLine(" chmod" , " 755" , " pre-commit" )
187- }
188- }
189- } else {
190- logger.lifecycle(" '.git/hooks' directory not found. Skipping installation of pre-commit hook." )
191- }
192- }
193- tasks.named(" assemble" ) {
194- dependsOn(installGitPreCommitHook)
195- }
196-
197171// region docPreprocessor
198172
199- // This task is used to add all generated sources (from processKDocsMain) to git
200173val generatedSourcesFolderName = " generated-sources"
201- val addGeneratedSourcesToGit by tasks.creating(GitTask ::class ) {
202- directory.set(file(" ." ))
203- command.set(" add" )
204- args.set(listOf (" -A" , generatedSourcesFolderName))
205- }
206174
207175// Backup the kotlin source files location
208176val kotlinMainSources: FileCollection = kotlin.sourceSets.main.get().kotlin.sourceDirectories
@@ -223,10 +191,6 @@ val processKDocsMain by creatingProcessDocTask(processKDocsMainSources) {
223191 }
224192 task {
225193 group = " KDocs"
226- doLast {
227- // ensure generated sources are added to git
228- addGeneratedSourcesToGit.executeCommand()
229- }
230194 }
231195}
232196
0 commit comments