Skip to content
Merged
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
190 changes: 167 additions & 23 deletions pom.client.xml
Original file line number Diff line number Diff line change
Expand Up @@ -936,29 +936,29 @@
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version> <!-- {x-version-update;org.codehaus.mojo:exec-maven-plugin;external_dependency} -->
<executions>
<execution>
<id>generate-overview-from-readme</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>python</executable>
<workingDirectory>${project.basedir}</workingDirectory>
<arguments>
<argument>../../../eng/pipelines/scripts/generate_overview_from_readme.py</argument>
<argument>--rf</argument>
<argument>${project.basedir}/README.md</argument>
<argument>--v</argument>
<argument>${project.version}</argument>
</arguments>
</configuration>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version> <!-- {x-version-update;org.codehaus.mojo:exec-maven-plugin;external_dependency} -->
<executions>
<execution>
<id>generate-overview-from-readme</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>python</executable>
<workingDirectory>${project.basedir}</workingDirectory>
<arguments>
<argument>../../../eng/pipelines/scripts/generate_overview_from_readme.py</argument>
<argument>--rf</argument>
<argument>${project.basedir}/README.md</argument>
<argument>--v</argument>
<argument>${project.version}</argument>
</arguments>
</configuration>
</plugin>
<!-- Add the overview argument to the javadoc args -->
<plugin>
Expand All @@ -972,6 +972,150 @@
</plugins>
</build>
</profile>

<profile>
<!-- separate profile for windows as the executable on windows is named npx.cmd and npx on other os families -->
<id>readme-codesnippet-windows</id>
<activation>
<property>
<name>readme-codesnippet-windows</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version> <!-- {x-version-update;org.codehaus.mojo:exec-maven-plugin;external_dependency} -->
<executions>
<execution>
<id>code-snippet-for-readme-windows</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npx.cmd</executable>
<arguments>
<argument>embedme</argument>
<argument>sdk/*/azure-*/README.md</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<!-- Profiles for updating README file using embedme tool to inject code snippets from compilable Java source files.
Activate the profile below to update README files when corresponding Java files are updated. -->
<profile>
<id>readme-codesnippet</id>
<activation>
<property>
<name>readme-codesnippet</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version> <!-- {x-version-update;org.codehaus.mojo:exec-maven-plugin;external_dependency} -->
<executions>
<execution>
<id>code-snippet-for-readme</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npx</executable>
<arguments>
<argument>embedme</argument>
<argument>sdk/*/azure-*/README.md</argument>
</arguments>
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this also cover the README in modules. For example

sdk/eventhubs/README.md
sdk/eventhubs/azure-messaging-eventhubs/README.md

Copy link
Member Author

Choose a reason for hiding this comment

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

As discussed, the code samples should only be at the module level and shouldn't be at sdk/*/ level. So, not including those READMEs here.

</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<!-- separate profile for windows as the executable on windows is named npx.cmd and npx on other os families -->
<id>verify-readme-windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version> <!-- {x-version-update;org.codehaus.mojo:exec-maven-plugin;external_dependency} -->
<executions>
<execution>
<id>verify-readme-codesnippet-windows</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npx.cmd</executable>
<arguments>
<argument>embedme</argument>
<argument>--verify</argument>
<argument>sdk/*/azure-*/README.md</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<!-- Verify that there are no changes to readme file. Build fails if the there's a difference in README
after running the embedme tool. -->
<profile>
<id>verify-readme</id>
<activation>
<os>
<family>!windows</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version> <!-- {x-version-update;org.codehaus.mojo:exec-maven-plugin;external_dependency} -->
<executions>
<execution>
<id>verify-readme-codesnippet</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npx</executable>
<arguments>
<argument>embedme</argument>
<argument>--verify</argument>
<argument>sdk/*/azure-*/README.md</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<modules>
Expand Down