Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language source set documentation #196

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions subprojects/docs/docs.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import dev.gradleplugins.fixtures.sample.JavaBasicGradlePlugin
import dev.gradleplugins.fixtures.sources.NativeSourceElement
import dev.gradleplugins.fixtures.sources.SourceElement
import dev.nokee.docs.PluginManagementBlock
import dev.nokee.docs.tasks.AsciicastCompile
import dev.nokee.docs.tasks.CreateAsciinema
import dev.nokee.docs.tasks.ExtractScreenshot
Expand All @@ -8,8 +12,6 @@ import dev.nokee.platform.jni.fixtures.*
import dev.nokee.platform.jni.fixtures.elements.CppGreeter
import dev.nokee.platform.jni.fixtures.elements.SwiftGreeter
import dev.nokee.platform.nativebase.fixtures.*
import dev.gradleplugins.fixtures.sample.*
import dev.nokee.docs.PluginManagementBlock

import java.text.SimpleDateFormat

Expand Down Expand Up @@ -131,6 +133,22 @@ documentation {
'publish-jni-library-with-target-machines' {
template = new JavaJniCppGreeterLib('publish-jni-library-with-target-machines')
}
'jni-library-with-custom-source-layout' {
template = new NativeSourceElement() {
private final JavaJniCppGreeterLib delegate = new JavaJniCppGreeterLib('jni-library-with-custom-source-layout')

@Override
SourceElement getSources() {
return empty()
}

@Override
void writeToProject(File projectDir) {
ofSources(delegate).writeToSourceDir(new File(projectDir, 'srcs'))
ofHeaders(delegate).writeToSourceDir(new File(projectDir, 'incs'))
}
}
}
'jni-library-with-resource-path' {
template = new JavaJniCppGreeterLib('jni-library-with-resource-path')
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
digraph typicalComponentSourceConfiguration {
graph [ dpi = 100, fontname="Sans"];
node [fontname = "Sans"];
edge [fontname = "Sans"];
graph[splines=ortho]
node [shape=rectangle, fixedsize=true, width=2.5, height=0.5];

sources[shape=underline label="application.sources" width=1.6]
dot2[shape=none label="." width=0.01]
configureEach[shape=underline label="configureEach" width=1.2]
leftMustash[shape=none label="{" width=0.01]
from[shape=underline label="from('src')" width=1.2]
rightMustash[shape=none label="}" width=0.01]
{rank=same sources dot2 configureEach leftMustash from rightMustash}

{0001 [width=0, shape=point];}
from -> 0001 -> sourceSet[arrowhead=none]
{rank=same; 0001 sourceSet}

{0010, 0020 [width=0, shape=point];}
configureEach -> 0010 -> 0020 -> sourceView[arrowhead=none]
{rank=same; 0020 sourceView}

{0100, 0200, 0300 [width=0, shape=point];}
sources -> 0100 -> 0200 -> 0300 -> componentSources[arrowhead=none]
{rank=same; 0300 componentSources}

sourceSet[style=none label="Source set"]
sourceView[style=none label="Source view"]
componentSources[style=none label="Component sources"]
}
Loading