Skip to content

Commit 097d418

Browse files
committed
Fix task configuration syntax and rename to docFx naming convention
- Fix: Use tasks.docFx { } and tasks.docFxZip { } syntax (tasks must be accessed via tasks container) - Rename extension: docfxConfig → docFxConfig (capital F for consistency) - Rename plugin class: DocfxPlugin → DocFxPlugin (capital F for consistency) - Update all references in README, CHANGELOG, and build scripts - Fixes 'Could not find method docFx()' error in build scripts
1 parent 8b630c3 commit 097d418

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
* Updated `isDocfxNativelySupported()` and `isDocfxInPath()` to check `~/.dotnet/tools/docfx` location
1414

1515
### Changed
16-
* **BREAKING**: Extension renamed from `docfx` to `docfxConfig` to avoid conflict with task names
17-
* Use `docfxConfig { }` to configure extension properties
16+
* **BREAKING**: Extension renamed from `docfx` to `docFxConfig` to match naming convention (capital F)
17+
* Use `docFxConfig { }` to configure extension properties
18+
* **BREAKING**: Plugin class renamed from `DocfxPlugin` to `DocFxPlugin` for consistency
19+
* Update `apply plugin: de.inetsoftware.docfx.DocfxPlugin` to `de.inetsoftware.docfx.DocFxPlugin`
1820
* **BREAKING**: All tasks renamed to follow consistent `docFx` prefix naming schema (capital F):
1921
* `info``docFxInfo` - Displays DocFX version information
2022
* `docfx``docFx` - Generates documentation (main task)

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ buildscript {
6060
6161
apply plugin: 'de.inetsoftware.docfx'
6262
63-
docfxConfig {
63+
docFxConfig {
6464
source = 'docfx.json'
6565
docsHome = '/path/to/docfx' // Optional: defaults to DOCFX_HOME environment variable
6666
}
@@ -73,7 +73,7 @@ plugins {
7373
id 'de.inetsoftware.docfx' version '0.0.7'
7474
}
7575
76-
docfxConfig {
76+
docFxConfig {
7777
source = 'docfx.json'
7878
}
7979
```
@@ -112,12 +112,12 @@ import de.inetsoftware.docfx.DocfxExtension
112112
if (!DocfxExtension.isDocfxNativelySupported()) {
113113
// DocFX is not in PATH, download and extract zip version
114114
// ... your download/extract logic here
115-
docfxConfig {
115+
docFxConfig {
116116
docsHome = '/path/to/extracted/docfx'
117117
}
118118
} else {
119119
// DocFX is available in PATH, plugin will use it automatically
120-
docfxConfig {
120+
docFxConfig {
121121
source = 'docfx.json'
122122
// docsHome not needed - will use PATH version
123123
}
@@ -126,7 +126,7 @@ if (!DocfxExtension.isDocfxNativelySupported()) {
126126

127127
### Configuration
128128

129-
The `docfxConfig` extension supports the following properties:
129+
The `docFxConfig` extension supports the following properties:
130130

131131
- **`source`** (String) - Path to the `docfx.json` configuration file or source file (e.g., `.dll`, `.csproj`). If not a `.json` file, the plugin will auto-generate `docfx.json` (required)
132132
- **`docsHome`** (String) - Path to DocFX installation directory (optional, defaults to `DOCFX_HOME` environment variable). The plugin will prefer `docfx` from PATH if available, even if `docsHome` is set
@@ -150,7 +150,7 @@ The `docfxConfig` extension supports the following properties:
150150
#### Basic Usage
151151

152152
```groovy
153-
docfxConfig {
153+
docFxConfig {
154154
source = 'docfx.json' // Use existing docfx.json
155155
docsHome = '/opt/docfx' // Optional
156156
}
@@ -165,7 +165,7 @@ docfxConfig {
165165
#### Auto-Generate docfx.json from Source File
166166

167167
```groovy
168-
docfxConfig {
168+
docFxConfig {
169169
source = 'path/to/MyAssembly.dll' // Plugin will auto-generate docfx.json
170170
title = 'My API Documentation'
171171
locale = 'en-US'
@@ -183,7 +183,7 @@ docfxConfig {
183183
#### With Locale and Environment Variables
184184

185185
```groovy
186-
docfxConfig {
186+
docFxConfig {
187187
source = 'docfx.json'
188188
locale = 'de-DE' // Automatically sets LC_ALL, LANG, LC_CTYPE
189189
environment = [
@@ -195,7 +195,7 @@ docfxConfig {
195195
#### With Additional Resources
196196

197197
```groovy
198-
docfxConfig {
198+
docFxConfig {
199199
source = 'docfx.json'
200200
additionalResources = { root ->
201201
// Copy additional files into the docfx working directory

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ gradlePlugin {
4444
plugins {
4545
docfxPlugin {
4646
id = 'de.inetsoftware.docfx'
47-
implementationClass = 'de.inetsoftware.docfx.DocfxPlugin'
47+
implementationClass = 'de.inetsoftware.docfx.DocFxPlugin'
4848
displayName = 'Gradle DocFX Plugin'
4949
description = 'Gradle plugin for DocFX documentation generation.'
5050
tags.set(['docfx', 'documentation', 'dotnet'])

src/main/groovy/de/inetsoftware/docfx/DocfxPlugin.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import org.gradle.api.Plugin
44
import org.gradle.api.Project
55
import org.gradle.api.tasks.bundling.Zip
66

7-
class DocfxPlugin implements Plugin<Project> {
7+
class DocFxPlugin implements Plugin<Project> {
88

9-
private static final String DOCFX_CONFIG_EXTENSION = "docfxConfig"
9+
private static final String DOCFX_CONFIG_EXTENSION = "docFxConfig"
1010
private static final String INFO_TASK = "docFxInfo"
1111
private static final String CLEAN_TASK = "docFxClean"
1212
private static final String DOCS_TASK = "docFx"

0 commit comments

Comments
 (0)