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

[maven] (#379) Exclude license headers generation for javascript and typescript test files #380

Merged
Merged
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
36 changes: 13 additions & 23 deletions docs/versions/latest/Release.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,35 +39,25 @@
[//]: # (Optional But higlhy recommended Specify *NONE* if missing)
[//]: # (#### Relevant Documentation:)

### Add missing classes to `o11n-plugin-aria` and add missing methods to the existing classes
### *Exclude Javascript and Typescript test files during license header generation*

#### Previous Behavior

Many classes are missing completely compared with vRO API and some existing classes were missing some methods
In most archetypes that generate projects with Javascript or Typescript code license headers are added for all `*.ts` and `*.js` files.

#### Current Behavior

The following classes were added to `o11n-plugin-aria`:

- VraCloudAccount
- VraCloudAccountNsxT
- VraCloudAccountNsxTResult
- VraCloudAccountNsxV
- VraCloudAccountNsxVResult
- VraCloudAccountRegions
- VraRegion
- VraCloudAccountResult
- VraCloudAccountVsphereRegionEnumerationSpecification
- VraCloudAccountVsphereResult
- VraDataCollector
- VraDataCollectorResult
- VraDiskAttachmentSpecification
- VraDiskService
- VraDiskSnapshotSpecification

#### Related issue

<https://github.com/vmware/build-tools-for-vmware-aria/issues/347>
All archetypes that generate projects with Javascript and Typescript code have exclusion rules that skip adding license headers for test files.

### *Re-enable license plugin `<excludes>` configuration inheritance through `pom.xml` property value*

#### Previous Behavior

License plugin `<excludes>` uses hardcoded value defined in the `base-package` -> `pom.xml`.

#### Current Behavior

The default value of license plugin's `<excludes>` configuration can be overwritten by providing `<license.excludes>` property in a projects `pom.xml` -> `<properties>` tag.

## Upgrade procedure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
#if (!${licenseTechnicalPreview} || ${licenseTechnicalPreview} == 'false')<license.organizationName>TODO: Enter Organization name</license.organizationName>#end

<license.includes>**/*.js,**/*.ts</license.includes>
<license.excludes></license.excludes>
<license.excludes>/test/**/*.js</license.excludes>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,32 @@
<artifactId>\${artifactId}.actions</artifactId>
<version>\${version}</version>
<packaging>package</packaging>
#if (${licenseTechnicalPreview} == 'true' || ${licenseTechnicalPreview} == 'yes' || ${licenseTechnicalPreview} == 'y')
#set( $licenseName = 'Technical Preview License' )
#set( $licenseUrl = 'https://flings.vmware.com/vrealize-build-tools/license' )
#else
#set( $licenseName = 'TODO: Enter License name' )
#if(!${licenseUrl} || ${licenseUrl} == '')
#set( $licenseUrl = 'https://todo.put.url.to.my.licence/license' )
#end
#end

<description>
This package is licensed under ${licenseUrl}
</description>
<licenses>
<license>
<name>\${licenseName}</name>
<url>\${licenseUrl}</url>
<distribution>pom</distribution>
</license>
</licenses>

<properties>
<generated.from>${artifactId}</generated.from>
#if (!${licenseTechnicalPreview} || ${licenseTechnicalPreview} == 'false')<license.organizationName>TODO: Enter Organization name</license.organizationName>#end

<license.includes>**/*.js</license.includes>
<license.excludes>**/*Tests.js</license.excludes>
<license.excludes>/test/**/*.js</license.excludes>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
#if (!${licenseTechnicalPreview} || ${licenseTechnicalPreview} == 'false')<license.organizationName>TODO: Enter Organization name</license.organizationName>#end

<license.includes>**/*.js,**/*.ts</license.includes>
<license.excludes>**/*.test.ts,**/*Test.js</license.excludes>
<license.excludes>**/*.test.ts,/test/**/*.js</license.excludes>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
#if (!${licenseTechnicalPreview} || ${licenseTechnicalPreview} == 'false')<license.organizationName>TODO: Enter Organization name</license.organizationName>#end

<license.includes>**/*.js,**/*.ts</license.includes>
<license.excludes>**/*.test.ts,**/*Test.js</license.excludes>
<license.excludes>**/*.test.ts,/test/**/*.js</license.excludes>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
#if (!${licenseTechnicalPreview} || ${licenseTechnicalPreview} == 'false')<license.organizationName>TODO: Enter Organization name</license.organizationName>#end

<license.includes>**/*.js,**/*.ts</license.includes>
<license.excludes></license.excludes>
<license.excludes>**/*.test.ts,/test/**/*.js</license.excludes>
</properties>
</project>
4 changes: 2 additions & 2 deletions maven/base-package/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<license.canUpdateCopyright>true</license.canUpdateCopyright>
<license.canUpdateDescription>true</license.canUpdateDescription>
<license.includes>**/*.js,**/*.ts</license.includes>
<license.excludes>**/*.json,**/*.ftl,**/resources/**/*.*,**/archetype-resources/**/*.*</license.excludes>
</properties>
<profiles>
<profile>
Expand Down Expand Up @@ -110,6 +111,7 @@
<canUpdateCopyright>${license.canUpdateCopyright}</canUpdateCopyright>
<canUpdateDescription>${license.canUpdateDescription}</canUpdateDescription>
<includes>${license.includes}</includes>
<excludes>${license.excludes}</excludes>
<aggregate>true</aggregate>
<excludedArtifacts>maven-surefire-plugin</excludedArtifacts>
<extraExtensions>
Expand All @@ -119,8 +121,6 @@
<psd>properties</psd>
<psm>properties</psm>
</extraExtensions>
<excludes>
**/*.json,**/*.ftl,**/resources/**/*.*,**/archetype-resources/**/*.*</excludes>
</configuration>
<executions>
<execution>
Expand Down
Loading