Skip to content

Use a separate Knit tool #1486

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

Merged
merged 6 commits into from
Feb 14, 2020
Merged

Use a separate Knit tool #1486

merged 6 commits into from
Feb 14, 2020

Conversation

elizarov
Copy link
Contributor

@elizarov elizarov commented Aug 28, 2019

Knit is now a separate tool with lots of flexibility, providing cleaner and more configurable use with more features (auto numbering, template-based tests, etc)

@elizarov elizarov force-pushed the knit-2.0 branch 2 times, most recently from f6afb6b to a646bde Compare August 29, 2019 08:50
@elizarov elizarov changed the title Knit: Remove copypaste from markdown files, introduce props Knit: Various significant implements Aug 29, 2019
@elizarov elizarov changed the title Knit: Various significant implements Knit: Various improvements Aug 29, 2019
@elizarov elizarov changed the title Knit: Various improvements [DRAFT] Knit: Various improvements Nov 28, 2019
@elizarov elizarov changed the title [DRAFT] Knit: Various improvements Use a separate Knit tool version 0.1.0 Feb 7, 2020
@elizarov elizarov marked this pull request as ready for review February 7, 2020 12:06
@elizarov elizarov requested a review from qwwdfsad February 7, 2020 12:06
@elizarov elizarov force-pushed the knit-2.0 branch 3 times, most recently from 79afe34 to 5b2d288 Compare February 11, 2020 14:48
Copy link
Collaborator

@qwwdfsad qwwdfsad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outstanding work!

@qwwdfsad
Copy link
Collaborator

@elizarov
Copy link
Contributor Author

https://teamcity.jetbrains.com/buildConfiguration/KotlinTools_KotlinxCoroutines_BuildWindows/2764082?buildTab=log&focusLine=3171&linesState=41 build on Windows consistently fails, please investigate

The reason is:

  Execution failed for task ':kotlinx-coroutines-android:dokka'. com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting constructor, java.lang.RuntimeException: Exception while loading package-list from ExternalDocumentationLinkImpl(url=https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/, packageListUrl=file://C:/BuildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/build/dokka/kotlinx-coroutines-core/package-list)
  at org.jetbrains.dokka.ExternalDocumentationLinkResolver.<init>(ExternalDocumentationLinkResolver.kt:27)
  at org.jetbrains.dokka.ExternalDocumentationLinkResolver.class(ExternalDocumentationLinkResolver.kt:27)
  while locating org.jetbrains.dokka.ExternalDocumentationLinkResolver
    for parameter 4 at org.jetbrains.dokka.DeclarationLinkResolver.<init>(DeclarationLinkResolver.kt:13)
  while locating org.jetbrains.dokka.DeclarationLinkResolver
    for parameter 0 at org.jetbrains.dokka.PackageDocs.<init>(PackageDocs.kt:13)
  at org.jetbrains.dokka.PackageDocs.class(PackageDocs.kt:12)
  while locating org.jetbrains.dokka.PackageDocs

Build script now runs dokka, too, as a prerequisite to knitCheck (to make sure all committed docs files are file), so it exposes all the dokka problem now. This is good, actually.

@elizarov elizarov requested a review from qwwdfsad February 12, 2020 12:20
@elizarov elizarov changed the title Use a separate Knit tool version 0.1.0 Use a separate Knit tool Feb 12, 2020
* Hierarchical knit.properties files are introduced which are
  gathered while walking up the directory tree with the properties
  in knit resources being top-level ones.
* Freemarker templates for "knit.include" (top-level of example files)
  and "test.template" (test template) are introduced with locations that
  are resolved from properties.
* KNIT and TEST_OUT directives are not supported anymore.
 - Knitting is controlled by "knit.dir" and "knit.pattern" props.
 - "test.name" prop or TEST_NAME directive drives test gen.
* All markdown files are now clean of top-level knit-related boilerplate
  (only TEST_NAME directive is remaining in some)
* All example files are renumbered. It affects example-basic-xx,
  which had the legacy numbering with later insertions.
* All auto-generated files now have the correct source-file name
  specified at their beginning, due to consistent use of template
  substitution.
* No need to customize knit.pattern anymore (works out-of-the box)
* "knit.name" is automatically generated based on example's file name
  "example-basic-01" -> "exampleBasic01"
* Not match-pattern-group woodoo anymore, "knit.pattern" cannot have any
  user-defined match groups.
* No need to look for "package xxx" in knitted sources, as the
  example's package is always ${knit.package}.${knit.name}
* Simpler test names:
  testKotlinxCoroutinesGuideBasic01 -> testExampleBasic01
* Replaced END_TOC with END directive
* Build-scripts are improved:
  - Consistent code to use mavenLocal when snapshots versions are used.
  - Proper substitution logic to use Android AAR files so that Dokka has correct links to Google APIs.
  - Google repository is added to all projects.
@elizarov elizarov merged commit 660c2d7 into develop Feb 14, 2020
@elizarov elizarov deleted the knit-2.0 branch February 14, 2020 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants