@@ -168,41 +168,9 @@ tasks.withType<KorroTask> {
168
168
dependsOn(copySamplesOutputs)
169
169
}
170
170
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
-
197
171
// region docPreprocessor
198
172
199
- // This task is used to add all generated sources (from processKDocsMain) to git
200
173
val 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
- }
206
174
207
175
// Backup the kotlin source files location
208
176
val kotlinMainSources: FileCollection = kotlin.sourceSets.main.get().kotlin.sourceDirectories
@@ -223,10 +191,6 @@ val processKDocsMain by creatingProcessDocTask(processKDocsMainSources) {
223
191
}
224
192
task {
225
193
group = " KDocs"
226
- doLast {
227
- // ensure generated sources are added to git
228
- addGeneratedSourcesToGit.executeCommand()
229
- }
230
194
}
231
195
}
232
196
0 commit comments