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

Update template plugin to 1.3.0.1139 #216

Merged
merged 1 commit into from
May 16, 2024
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ v3.0 generates plugins that are compatible with versions of SonarQube from v7.9.

v3.1 generates plugins that are compatible with versions of SonarQube from v7.9.6 (tested with the latest available version at time of release i.e. v9.7).

v4.0 generates plugins that are compatible with versions of SonarQube from v9.9 (tested with the latest available version at time of release i.e. v10.5.1).
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a link to the template repository somewhere in the README?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, as it will likely move.


If you have an existing plugin that was generated with v1.0 of the SDK and want to use the plugin with SonarQube 7.0 or later, you will need to create a new plugin using v2.0 of the SDK. If you customized the _SQALE.xml_ file for your v1.0 plugin, you will need to move the remediation information to the _rules.xml_ file for the v2.0 plugin.

#### Changes between v1.0 and v2.0
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion RoslynPluginGenerator/RoslynPluginJarBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class RoslynPluginJarBuilder
/// <summary>
/// Name of the embedded resource that contains the .jar file to update
/// </summary>
private const string TemplateJarResourceName = "SonarQube.Plugins.Roslyn.Resources.sonar-roslyn-sdk-template-plugin-1.2.0.76.jar";
private const string TemplateJarResourceName = "SonarQube.Plugins.Roslyn.Resources.sonar-roslyn-sdk-template-plugin-1.3.0.1139.jar";

// Locations in the jar archive where various file should be embedded.
// Using forward-slash since that is the separator used by Java for archive entry names.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@
</ItemGroup>

<ItemGroup Label="Embedded jar file">
<!-- Corresponsds to the following commit:

https://github.com/SonarSource/sonarqube-roslyn-sdk-template-plugin/commit/6e4dd88878f40a44231365494db768a7af3e6096
-->
<EmbeddedResource Include="Resources\sonar-roslyn-sdk-template-plugin-1.2.0.76.jar" />
<EmbeddedResource Include="Resources\sonar-roslyn-sdk-template-plugin-1.3.0.1139.jar" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions Tests/IntegrationTests/Roslyn/RoslynGenTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void RoslynPlugin_GenerateForDependencyAnalyzers_Succeeds()
// Act
NuGetPackageHandler nuGetHandler = new NuGetPackageHandler(fakeRemotePkgMgr.LocalRepository, localPackageDestination, logger);
AnalyzerPluginGenerator apg = new AnalyzerPluginGenerator(nuGetHandler, logger);
ProcessedArgs args = new ProcessedArgs(targetPkg.Id, targetPkg.Version, "cs", null, false,
ProcessedArgs args = new ProcessedArgs(targetPkg.Id, targetPkg.Version, "cs", null, false,
true /* generate plugins for dependencies with analyzers*/, outputDir, null);
bool result = apg.Generate(args);

Expand Down Expand Up @@ -399,13 +399,13 @@ private static void AssertPackagePropertiesInManifest(IPackage package, JarManif
manifestReader.FindValue("Plugin-Developers").Should().Be(String.Join(",", package.Authors));
manifestReader.FindValue("Plugin-TermsConditionsUrl").Should().Be(package.LicenseUrl.ToString());
}

private static void AssertFixedValuesInManifest(JarManifestReader reader)
{
reader.FindValue("Sonar-Version").Should().Be("7.9");
reader.FindValue("Sonar-Version").Should().Be("9.14.0.375");
reader.FindValue("Plugin-Class").Should().Be("org.sonar.plugins.roslynsdk.RoslynSdkGeneratedPlugin");
reader.FindValue("SonarLint-Supported").Should().Be("false");
reader.FindValue("Plugin-Dependencies").Should().Be("META-INF/lib/jsr305-1.3.9.jar META-INF/lib/commons-io-2.6.jar META-INF/lib/stax2-api-3.1.4.jar META-INF/lib/staxmate-2.0.1.jar META-INF/lib/stax-api-1.0.1.jar");
reader.FindValue("Plugin-Dependencies").Should().Be("META-INF/lib/jsr305-3.0.2.jar META-INF/lib/staxmate-2.4.1.jar META-INF/lib/stax2-api-4.2.1.jar META-INF/lib/commons-io-2.16.1.jar");
}

private void CheckEmbeddedAnalyzerPayload(ZipFileChecker jarChecker, string staticResourceName,
Expand Down