<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Matt Shoemaker</title>
    <description>The latest articles on Forem by Matt Shoemaker (@matt_shoemaker_86e9acb105).</description>
    <link>https://forem.com/matt_shoemaker_86e9acb105</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1761407%2Fb3feb2b8-e291-46cb-aa5a-384c64ae0cf1.png</url>
      <title>Forem: Matt Shoemaker</title>
      <link>https://forem.com/matt_shoemaker_86e9acb105</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/matt_shoemaker_86e9acb105"/>
    <language>en</language>
    <item>
      <title>Meet Stratify: Optimizing KSP Plugin Development</title>
      <dc:creator>Matt Shoemaker</dc:creator>
      <pubDate>Mon, 22 Jul 2024 16:53:26 +0000</pubDate>
      <link>https://forem.com/matt_shoemaker_86e9acb105/meet-stratify-optimizing-ksp-plugin-development-233f</link>
      <guid>https://forem.com/matt_shoemaker_86e9acb105/meet-stratify-optimizing-ksp-plugin-development-233f</guid>
      <description>&lt;p&gt;I’m excited to share Stratify, a new library designed to make Kotlin Symbol Processing (KSP) plugin development a breeze.&lt;/p&gt;




&lt;h1&gt;
  
  
  Overview
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Stratify&lt;/strong&gt; enables you to build Kotlin Symbol Processing (KSP) plugins more easily than ever before. &lt;strong&gt;Stratify&lt;/strong&gt; abstracts &lt;br&gt;
away nearly all of the boilerplate of writing a KSP plugin, and integrates Kotlin coroutines into your KSP code to &lt;br&gt;
maximize the efficiency of your Symbol Processors.&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;Stratify&lt;/strong&gt; all you need to do is set up a &lt;code&gt;Strategy&lt;/code&gt; and a &lt;code&gt;Processor&lt;/code&gt;, and &lt;strong&gt;Stratify&lt;/strong&gt; will automate the rest of the boilerplate&lt;br&gt;
to select nodes efficiently. A &lt;code&gt;Strategy&lt;/code&gt; defines which nodes to visit, and a &lt;code&gt;Processor&lt;/code&gt; defines an operation to perform on each of&lt;br&gt;
those nodes. You can have any number of strategies, and each one can have any number of processors. This is an extremely&lt;br&gt;
powerful way to build your KSP plugin, because your code will be easy to understand, easy to change, and infinitely flexible.&lt;br&gt;
The &lt;strong&gt;Stratify&lt;/strong&gt; framework will keep your code clean, keep your architecture scalable, simplify maintenance, and make experimentation&lt;br&gt;
as easy as swapping in a new processor.&lt;/p&gt;

&lt;p&gt;Stratify is available now via &lt;a href="https://central.sonatype.com/artifact/io.github.mattshoe.shoebox/Stratify/versions" rel="noopener noreferrer"&gt;Maven Central&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Stratify is in Beta testing phase, and I’m looking to find developers willing to try it out so we can identify any optimizations, enhancements, and exploring new use-cases. Your feedback will really help to improve this library to be something that makes us all better!&lt;/p&gt;

&lt;p&gt;Here is the &lt;a href="https://github.com/mattshoe/stratify/tree/main" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Efficiency&lt;/strong&gt;: Take advantage of built-in support for Coroutines to increase efficiency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility&lt;/strong&gt;: Define any number of &lt;code&gt;Processors&lt;/code&gt; for a given annotation, and control the order in which they run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simplicity&lt;/strong&gt;: Simple define &lt;code&gt;Processor&lt;/code&gt;, plug it into a &lt;code&gt;Strategy&lt;/code&gt;, and &lt;strong&gt;Stratify&lt;/strong&gt; will do the rest!&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt;: Designed to handle growing projects, &lt;strong&gt;Stratify&lt;/strong&gt;'s robust framework encourages scalable and sustainable development practices, making it ideal for both small teams and large enterprises.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strategy Pattern&lt;/strong&gt;: Makes use of the strategy pattern for flexible and maintainable code generation.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Benefits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Less Code, More Features&lt;/strong&gt;: &lt;strong&gt;Stratify&lt;/strong&gt; abstracts away the complex and tedious boilerplate, enabling developers to focus on the fun stuff.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Architecture&lt;/strong&gt;: By enforcing a consistent architecture with the strategy pattern, &lt;strong&gt;Stratify&lt;/strong&gt; can help keep your codebases clean, modular, and easy to manage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Coroutines&lt;/strong&gt;: With &lt;strong&gt;Stratify's&lt;/strong&gt; built-in coroutines support, you get efficient, non-blocking operations, improving performance in large-scale projects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rapid Prototyping and Testing&lt;/strong&gt;: Developers can quickly implement and experiment with new processors, accelerating the development cycle.&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;
  
  
  Quick Start
&lt;/h1&gt;
&lt;h3&gt;
  
  
  1. Add Dependencies
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;Stratify&lt;/strong&gt; framework will transitively provide you with the KSP&lt;br&gt;
libraries you need for your development as well, so you only need one dependency.&lt;/p&gt;

&lt;p&gt;Add the following to your &lt;code&gt;build.gradle.kts&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nf"&gt;dependencies&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Note that this will also provide the KSP libraries you need!&lt;/span&gt;
    &lt;span class="nf"&gt;implementation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"io.github.mattshoe.shoebox:Stratify:1.1.0-beta15"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  
    &lt;span class="c1"&gt;// Provides a simple DSL to write compilation tests&lt;/span&gt;
    &lt;span class="nf"&gt;testImplementation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"io.github.mattshoe.shoebox:Stratify.Test:1.1.0-beta15"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Create an Annotation (Optional)
&lt;/h3&gt;

&lt;p&gt;If your &lt;code&gt;Processor&lt;/code&gt; relies on a custom annotation, now is the time!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;AnnotationTarget&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CLASS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nd"&gt;@Retention&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;AnnotationRetention&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SOURCE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;annotation&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyAnnotation&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Implement a &lt;code&gt;StratifySymbolProcessor&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Extend &lt;code&gt;StratifySymbolProcessor&lt;/code&gt; and implement the &lt;code&gt;strategies&lt;/code&gt; list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyProcessor&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;StratifySymbolProcessor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;buildStrategies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resolver&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Resolver&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;listOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nc"&gt;AnnotationStrategy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="k"&gt;annotation&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MyAnnotation&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nc"&gt;TODO&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Add your processors here once you implement them"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Create a &lt;code&gt;SymbolProcessorProvider&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Stratify&lt;/strong&gt; abstracts this step away for you, all you need to do is the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyProcessorProvider&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;SymbolProcessorProvider&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="n"&gt;stratifyProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;MyProcessor&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Add your META-INF File
&lt;/h3&gt;

&lt;p&gt;KSP requires you to have a metadata file that points to your provider from Step 4.&lt;/p&gt;

&lt;p&gt;Just create the following file:&lt;br&gt;&lt;br&gt;
&lt;code&gt;src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And inside the file just put the fully qualified name of your &lt;code&gt;SymbolProcessorProvider&lt;/code&gt; from step 4&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;com.foo.bar.MyProcessorProvider
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  7. Implement a &lt;code&gt;Processor&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Take the simple &lt;code&gt;Processor&lt;/code&gt; below. This processor inspects the KDoc on any class declaration, then uses Kotlin Poet &lt;br&gt;
to generate an extension function which returns the KDoc as a string:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DocReaderClassProcessor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Processor&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;KSClassDeclaration&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// Specify we're only interested in KSClassDeclaration&lt;/span&gt;
    &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;targetClass&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;KSClassDeclaration&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="c1"&gt;// The class of your generic type &lt;/span&gt;

    &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="k"&gt;suspend&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;process&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;KSClassDeclaration&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;GeneratedFile&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;packageName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;packageName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;className&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;simpleName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;fileName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"${className}_DocReader"&lt;/span&gt;

        &lt;span class="c1"&gt;// Generate a file that defines an extension function `SomeClass.readDoc()` &lt;/span&gt;
        &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;readDocFunction&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FunSpec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"readDoc"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;receiver&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ClassName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;packageName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;className&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;returns&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addStatement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"return %S"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;docString&lt;/span&gt; &lt;span class="o"&gt;?:&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;file&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FileSpec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;packageName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fileName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;readDocFunction&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

        &lt;span class="c1"&gt;// Return the set of files that we've generated for this node&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;setOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nc"&gt;GeneratedFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;packageName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;packageName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;fileName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fileName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;output&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  8. Choose a &lt;code&gt;Strategy&lt;/code&gt; and plug in your &lt;code&gt;Processor&lt;/code&gt;!
&lt;/h3&gt;

&lt;p&gt;The final step is to just choose your &lt;code&gt;Strategy&lt;/code&gt; and plug it into your &lt;code&gt;StratifySymbolProcessor&lt;/code&gt;!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyProcessor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;StratifySymbolProcessor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;buildStrategies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resolver&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Resolver&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;listOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nc"&gt;AnnotationStrategy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="k"&gt;annotation&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MyAnnotation&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nc"&gt;DocReaderClassProcessor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h1&gt;
  
  
  What is a Strategy?
&lt;/h1&gt;

&lt;p&gt;In the context of &lt;strong&gt;Stratify&lt;/strong&gt;, a strategy simply defines a sequence of operations to run against a very specific subset of &lt;code&gt;KSNode&lt;/code&gt; instances.&lt;br&gt;
For example, you may have a strategy to run a sequence of operations against all source code annotated with a specific Annotation. &lt;br&gt;
Or perhaps you need to run a set of operations against all files that are suffixed by "ViewModel". Or perhaps you need&lt;br&gt;
to run a sequence of operations against all functions suffixed with "Async". There are myriad possible scenarios you &lt;br&gt;
may come across.&lt;/p&gt;
&lt;h3&gt;
  
  
  Case Study
&lt;/h3&gt;

&lt;p&gt;The most common use-case is the &lt;code&gt;AnnotationStrategy&lt;/code&gt;. This strategy defines a sequence of &lt;code&gt;Processors&lt;/code&gt; to run against &lt;br&gt;
all &lt;code&gt;KSAnnotated&lt;/code&gt; nodes which are annotated by the given annotation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nc"&gt;AnnotationStrategy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;annotation&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MyAnnotation&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;MyClassProcessor&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="nc"&gt;MyFunctionProcessor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the sample above, the &lt;code&gt;AnnotationStrategy&lt;/code&gt; behaves like a "filter" which only accepts &lt;code&gt;KSNode&lt;/code&gt; instances that are &lt;br&gt;
annotated with &lt;code&gt;MyAnnotation&lt;/code&gt;. This means its upper bound is the &lt;code&gt;KSAnnotated&lt;/code&gt; type.&lt;/p&gt;

&lt;p&gt;This strategy has 2 processors: &lt;code&gt;MyClassProcessor&lt;/code&gt; and &lt;code&gt;MyFunctionProcessor&lt;/code&gt;. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;MyClassProcessor&lt;/code&gt; is a &lt;code&gt;Processor&lt;/code&gt; that ONLY handles &lt;code&gt;KSClassDeclaration&lt;/code&gt; nodes. Since this processor is used 
inside the &lt;code&gt;AnnotationStrategy&lt;/code&gt; for &lt;code&gt;MyAnnotation&lt;/code&gt;, it will only process instances of &lt;code&gt;KSClassDeclaration&lt;/code&gt; which are also annotated by &lt;code&gt;MyAnnotation&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;MyFunctionProcessor&lt;/code&gt; behaves similarly, but ONLY processes &lt;code&gt;KSFunctionDeclaration&lt;/code&gt; nodes. Since this processor is used 
inside the &lt;code&gt;AnnotationStrategy&lt;/code&gt; for &lt;code&gt;MyAnnotation&lt;/code&gt;, it will only process instances of &lt;code&gt;KSFunctionDeclaration&lt;/code&gt; which are also annotated by &lt;code&gt;MyAnnotation&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;


&lt;h1&gt;
  
  
  What is a Processor?
&lt;/h1&gt;

&lt;p&gt;With &lt;strong&gt;Stratify&lt;/strong&gt;, a &lt;code&gt;Processor&lt;/code&gt; defines one single operation that is performed on a specific sub-type of &lt;code&gt;KSNode&lt;/code&gt;. &lt;br&gt;
This is most often used to generate a new code file, but you can leverage a &lt;code&gt;Processor&lt;/code&gt; to run any type of operation you&lt;br&gt;
may need. You may use it to aggregate data, or some other use-case you may come across. You are not required to return &lt;br&gt;
any &lt;code&gt;GeneratedFile&lt;/code&gt; from your processor.&lt;/p&gt;
&lt;h3&gt;
  
  
  Case Study
&lt;/h3&gt;

&lt;p&gt;Consider the simple &lt;code&gt;Processor&lt;/code&gt; below. &lt;br&gt;
This processor inspects the KDoc on a class declaration, then generates an extension function which returns the KDoc &lt;br&gt;
as a string, using KotlinPoet to generate the code.&lt;/p&gt;

&lt;p&gt;Note that, by design, a &lt;code&gt;Processor&lt;/code&gt; implementation is not tied to any particular annotation or other filtering logic. It simply &lt;br&gt;
runs against all the &lt;code&gt;KSNode&lt;/code&gt; resolved by your &lt;code&gt;Strategy&lt;/code&gt;. This allows your &lt;code&gt;Processor&lt;/code&gt; implementations to remain highly reusable&lt;br&gt;
and encourages separation of concerns.&lt;/p&gt;

&lt;p&gt;For example, using the processor below in a &lt;code&gt;FilePatternStrategy&lt;/code&gt; would mean that processor only runs against the classes&lt;br&gt;
contained within files matching the specified file pattern. Or using this in a &lt;code&gt;FunctionNameStrategy&lt;/code&gt; means this processor&lt;br&gt;
would only run against the functions that match the function name specified in the &lt;code&gt;FunctionNameStrategy&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DocReaderClassProcessor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Processor&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;KSClassDeclaration&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// Specify we're only interested in KSClassDeclaration&lt;/span&gt;
    &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;targetClass&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;KSClassDeclaration&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="c1"&gt;// The class of your generic type &lt;/span&gt;

    &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="k"&gt;suspend&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;process&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;KSClassDeclaration&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;GeneratedFile&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;packageName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;packageName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;className&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;simpleName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;fileName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"${className}_DocReader"&lt;/span&gt;

        &lt;span class="c1"&gt;// Generate a file that defines an extension function `SomeClass.readDoc()` &lt;/span&gt;
        &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;readDocFunction&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FunSpec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"readDoc"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;receiver&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ClassName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;packageName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;className&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;returns&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addStatement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"return %S"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;docString&lt;/span&gt; &lt;span class="o"&gt;?:&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;file&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FileSpec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;packageName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fileName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;readDocFunction&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

        &lt;span class="c1"&gt;// Return the set of files that we've generated for this node&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;setOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nc"&gt;GeneratedFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;packageName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;packageName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;fileName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fileName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;output&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h1&gt;
  
  
  Built-In Strategies
&lt;/h1&gt;
&lt;h3&gt;
  
  
  AnnotationStrategy
&lt;/h3&gt;

&lt;p&gt;Defines a &lt;code&gt;Strategy&lt;/code&gt; whose processors will receive all instances of &lt;code&gt;KSAnnotated&lt;/code&gt; nodes which are annotated by the &lt;br&gt;
specified annotation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nc"&gt;AnnotationStrategy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;annotation&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DocReader&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;DocReaderClassProcessor&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="nc"&gt;DocReaderFunctionProcessor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  FilePatternStrategy
&lt;/h3&gt;

&lt;p&gt;Defines a &lt;code&gt;Strategy&lt;/code&gt; whose processors will receive all instances of &lt;code&gt;KSFile&lt;/code&gt; nodes whose name matches the given pattern.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nc"&gt;FilePatternStrategy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;pattern&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;".*ViewModel"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;DocReaderClassProcessor&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="nc"&gt;DocReaderFunctionProcessor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  FileNameStrategy
&lt;/h3&gt;

&lt;p&gt;Defines a &lt;code&gt;Strategy&lt;/code&gt; whose processors will receive all instances of &lt;code&gt;KSFile&lt;/code&gt; nodes whose name exactly matches the given name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nc"&gt;FileNameStrategy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"SomeFileName"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;DocReaderClassProcessor&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="nc"&gt;DocReaderFunctionProcessor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  FunctionPatternStrategy
&lt;/h3&gt;

&lt;p&gt;Defines a &lt;code&gt;Strategy&lt;/code&gt; whose processors will receive all instances of &lt;code&gt;KSFunctionDeclaration&lt;/code&gt; nodes whose name matches the given pattern.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nc"&gt;FunctionPatternStrategy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;pattern&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;".*SomeFunction"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;DocReaderFunctionProcessor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  FunctionNameStrategy
&lt;/h3&gt;

&lt;p&gt;Defines a &lt;code&gt;Strategy&lt;/code&gt; whose processors will receive all instances of &lt;code&gt;KSFunctionDeclaration&lt;/code&gt; nodes whose name exactly matches the&lt;br&gt;
given name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nc"&gt;FunctionNameStrategy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"someFunctionName"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;DocReaderFunctionProcessor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  PropertyPatternStrategy
&lt;/h3&gt;

&lt;p&gt;Defines a &lt;code&gt;Strategy&lt;/code&gt; whose processors will receive all instances of &lt;code&gt;KSPropertyDeclaration&lt;/code&gt; nodes whose name matches the given pattern.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nc"&gt;PropertyPatternStrategy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;pattern&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;".*SomeProperty"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;DocReaderPropertyProcessor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  PropertyNameStrategy
&lt;/h3&gt;

&lt;p&gt;Defines a &lt;code&gt;Strategy&lt;/code&gt; whose processors will receive all instances of &lt;code&gt;KSPropertyDeclaration&lt;/code&gt; nodes whose name exactly matches the&lt;br&gt;
given name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nc"&gt;PropertyNameStrategy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"somePropertyName"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;DocReaderFunctionProcessor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  NewFilesStrategy
&lt;/h3&gt;

&lt;p&gt;Defines a &lt;code&gt;Strategy&lt;/code&gt; whose processors will receive all &lt;strong&gt;&lt;em&gt;new&lt;/em&gt;&lt;/strong&gt; &lt;code&gt;KSFile&lt;/code&gt; instances. The term "new" here is as defined by &lt;a href="https://github.com/google/ksp/blob/main/api/src/main/kotlin/com/google/devtools/ksp/processing/Resolver.kt#L31" rel="noopener noreferrer"&gt;&lt;code&gt;Resolver.getNewFiles&lt;/code&gt;&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nc"&gt;NewFilesStrategy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nc"&gt;DocReaderClassProcessor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Stratify is now in Beta testing phase, and I’m looking to find developers willing to try it out so we can identify any optimizations or enhancement to improve the library! I would love nothing more than to have a real community involved with me to enhance KSP development for all :)&lt;/p&gt;

&lt;p&gt;Happy Coding!!&lt;/p&gt;

</description>
      <category>kotlin</category>
      <category>android</category>
      <category>androiddev</category>
      <category>ksp</category>
    </item>
  </channel>
</rss>
