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

[ODS-6230] Migrate VisualStudioProjectTemplates to .NET 8 #1093

Merged
merged 9 commits into from
Jul 3, 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
128 changes: 128 additions & 0 deletions .github/workflows/Pkg EdFi.ProjectTemplates.Installer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.

name: Pkg EdFi.ProjectTemplates.Installer

on:
pull_request:
branches: ['main-5x', 'b-v*-patch*','feature-*']
push:
branches: ['main-5x', 'b-v*-patch*','feature-*']
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
INFORMATIONAL_VERSION: "5.4"
BUILD_INCREMENTER: "0"
AZURE_ARTIFACT_URL: "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json"
AZURE_ARTIFACT_NUGET_KEY: ${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }}
VSS_NUGET_EXTERNAL_FEED_ENDPOINTS : '{"endpointCredentials": [{"endpoint": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json","password": "${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }}"}]}'
CONFIGURATION: "Release"
REPOSITORY_DISPATCH_BRANCH: ${{ github.event.client_payload.branch }}
HEAD_REF: ${{ GITHUB.HEAD_REF }}
REF_NAME: ${{ GITHUB.REF_NAME }}
REPOSITORY_OWNER: ${{ GITHUB.REPOSITORY_OWNER }}

jobs:
build:

runs-on: windows-latest
steps:
- name: Check for Azure token
if: ${{ env.REPOSITORY_OWNER == 'Ed-Fi-Alliance-OSS' && env.AZURE_ARTIFACT_NUGET_KEY == '' }}
run: |
echo "::error::Missing Azure Token"
exit 1
- name: Support longpaths
run: git config --system core.longpaths true
- name: Checkout Ed-Fi-ODS
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS
path: Ed-Fi-ODS/
- name: Checkout Ed-Fi-ODS-Implementation
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS-Implementation
path: Ed-Fi-ODS-Implementation/
- name: Setup MSBuild for .NET Framework 4.8
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce #v2.0.0
- name: Cache Nuget packages
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 #v3.2.3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj*', '**/configuration.packages.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: update BUILD_INCREMENTER
run: |
$newRevision = ([int]${{ github.run_number }}) + ([int]${{env.BUILD_INCREMENTER}})
if ($newRevision -lt 0) {
$newRevision = 1
echo "BUILD_INCREMENTER=$newRevision">> $env:GITHUB_ENV
}
shell: powershell
- name: Update version number in source.extension.vsixmanifest file
working-directory: ./Ed-Fi-ODS/
run: |
$BuildCounter = ${{ github.run_number }}
$BuildIncrementer = ${{env.BUILD_INCREMENTER}}
$InformationalVersion = ${{ env.INFORMATIONAL_VERSION}}
$newRevision = ([int]$BuildCounter) + ([int]$BuildIncrementer)
$version = "$InformationalVersion.$newRevision"
Write-Host "ODS/API Version : $version"
$vsixManifestPath = "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/VisualStudioProjectTemplates/EdFi.ProjectTemplates.Installer/source.extension.vsixmanifest"
$vsixManifestContent = Get-Content $vsixManifestPath -Raw

# Use regex to find the first <Identity> tag and extract the Version attribute value
$versionRegex = '<Identity[^>]*\sVersion="([^"]+)"'
$match = [regex]::Match($vsixManifestContent, $versionRegex)
if ($match.Success) {
$currentVersion = $match.Groups[1].Value
Write-Host "Current Version: $currentVersion"

# Update the Version attribute with a new value
$newVersion = $version
$updatedContent = $vsixManifestContent -replace "$versionRegex", ('<Identity Id="EdFi.ProjectTemplates" Version="{0}"' -f $newVersion)

# Write the updated content back to the file
$updatedContent | Set-Content $vsixManifestPath
Write-Host "Version updated to: $newVersion"
} else {
Write-Host "Version attribute not found in <Identity> tag."
}
shell: powershell
- name: Restore NuGet packages
working-directory: ./Ed-Fi-ODS/
run: msbuild "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/VisualStudioProjectTemplates/EdFi.ProjectTemplates.sln" /t:Restore
shell: powershell
- name: build
run: msbuild "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/VisualStudioProjectTemplates/EdFi.ProjectTemplates.sln" /p:Configuration=${{ env.CONFIGURATION }}
shell: powershell
- name: pack using nuget nuspec file
working-directory: ./Ed-Fi-ODS/
shell: powershell
run: |
.\build.githubactions.ps1 pack -Configuration ${{ env.CONFIGURATION }} -InformationalVersion ${{ env.INFORMATIONAL_VERSION}} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -PackageName "EdFi.Suite3.ProjectTemplates.Installer" -NuspecFilePath "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/VisualStudioProjectTemplates/EdFi.ProjectTemplates.Installer/EdFi.ProjectTemplates.Installer.nuspec"
- name: Install-credential-handler
if: ${{ env.AZURE_ARTIFACT_NUGET_KEY != '' && github.event_name == 'workflow_dispatch' }}
working-directory: ./Ed-Fi-ODS/
run: |
.\build.githubactions.ps1 InstallCredentialHandler
shell: powershell
- name: publish
if: ${{ env.AZURE_ARTIFACT_NUGET_KEY != '' && github.event_name == 'workflow_dispatch' }}
working-directory: ./Ed-Fi-ODS/
run: |
.\build.githubactions.ps1 publish -InformationalVersion ${{ env.INFORMATIONAL_VERSION }} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -NuGetApiKey ${{ env.AZURE_ARTIFACT_NUGET_KEY }} -EdFiNuGetFeed ${{env.AZURE_ARTIFACT_URL}} -PackageName "EdFi.Suite3.ProjectTemplates.Installer"
shell: powershell
- name: Upload EdFi.Suite3.ProjectTemplates.Installer Artifacts
if: success()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: NugetPackages.Artifacts
path: ${{ github.workspace }}/Ed-Fi-ODS/NugetPackages/*.nupkg
2 changes: 1 addition & 1 deletion Application/EdFi.Ods.Api/Startup/OdsStartupBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ private string GetPluginFolder()
}

// in a developer environment the plugin folder is relative to the WebApi project
// "Ed-Fi-ODS-Implementation\Application\EdFi.Ods.WebApi\bin\Debug\netcoreapp3.1\..\..\..\" => "Ed-Fi-ODS-Implementation\Application\EdFi.Ods.WebApi"
// "Ed-Fi-ODS-Implementation/Application/EdFi.Ods.WebApi/bin/Debug/net8.0/../../../" => "Ed-Fi-ODS-Implementation/Application/EdFi.Ods.WebApi"
var projectDirectory = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory!, "..\\..\\..\\"));
var relativeToProject = Path.GetFullPath(Path.Combine(projectDirectory, Plugin.Folder));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="ApprovalTests" Version="5.7.1" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.2.0" />
<PackageReference Include="CommandLineParser" Version="2.8.0" />
<PackageReference Include="FakeItEasy" Version="7.3.0" />
<PackageReference Include="FluentValidation" Version="11.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="ApprovalTests" Version="6.0.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="FakeItEasy" Version="8.3.0" />
<PackageReference Include="FluentValidation" Version="11.9.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Shouldly" Version="4.0.3" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Shouldly" Version="4.2.1" />
</ItemGroup>

<ItemGroup>
Expand Down
24 changes: 12 additions & 12 deletions Utilities/CodeGeneration/EdFi.Ods.CodeGen/EdFi.Ods.CodeGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AsyncEnumerator" Version="4.0.2" />
<PackageReference Include="Autofac" Version="6.3.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.2.0" />
<PackageReference Include="CommandLineParser" Version="2.8.0" />
<PackageReference Include="DatabaseSchemaReader" Version="2.7.11" />
<PackageReference Include="FluentValidation" Version="11.9.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="6.0.0" />
<PackageReference Include="Autofac" Version="8.0.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="DatabaseSchemaReader" Version="2.11.0" />
<PackageReference Include="FluentValidation" Version="11.9.2" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.6" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="8.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Stubble.Core" Version="1.9.3" />
<PackageReference Include="Stubble.Core" Version="1.10.8" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
</ItemGroup>
Expand Down
5 changes: 1 addition & 4 deletions Utilities/CodeGeneration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ Ed-Fi ODS software developers and implementers.

## Prerequisites
To build the application the following tools are needed:
* .NET 6 SDK (https://dotnet.microsoft.com/download)
* .NET 8 SDK (https://dotnet.microsoft.com/download)
* Visual Studio 2022 (https://visualstudio.microsoft.com/downloads/)

## Testing the generated artifacts against the main solution
* Run `initdev` on the main solution first
* run `Rebuild-Solution` or `initdev -NoCodegen`

## Known issues
* must use Visual Studio 2022+ net6 is not compatible with Visual Studio 2019
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.CoreUtility">
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Ed-Fi API Composites Project Template")]
[assembly: AssemblyCopyright("Copyright © Ed-Fi Alliance 2018")]
[assembly: AssemblyCopyright("Copyright © Ed-Fi Alliance 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>$safeprojectname$</AssemblyName>
<RootNamespace>$safeprojectname$</RootNamespace>
<RestorePackages>true</RestorePackages>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.CoreUtility">
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Ed-Fi API Extensions Project Template")]
[assembly: AssemblyCopyright("Copyright © Ed-Fi Alliance 2018")]
[assembly: AssemblyCopyright("Copyright © Ed-Fi Alliance 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>$safeprojectname$</AssemblyName>
<RootNamespace>$safeprojectname$</RootNamespace>
<RestorePackages>true</RestorePackages>
Expand All @@ -13,7 +13,7 @@
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<Content Include="Artifacts\**\Metadata\*.xml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,18 @@
</ItemGroup>
<ItemGroup>
<Content Include="..\..\..\LICENSE.txt">
<Link>LICENSE.txt</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Link>LICENSE.txt</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="Release Notes.rtf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<TargetPath>extension.vsixmanifest</TargetPath>
</None>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>EdFi.Suite3.ProjectTemplates.Installer</id>
<version>0.0.0</version>
<authors>Ed-Fi Alliance</authors>
<owners>Ed-Fi Alliance</owners>
<copyright>$copyright$</copyright>
<projectUrl>https://github.com/Ed-Fi-Alliance-OSS/Ed-Fi-ODS</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>EdFi.Suite3.ProjectTemplates.Installer</description>
<releaseNotes></releaseNotes>
<license type="file">LICENSE.txt</license>
</metadata>
<files>
<file src="bin\$configuration$\LICENSE.txt" />
<file src="bin\$configuration$\EdFi.ProjectTemplates.Installer.vsix" target="." />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Ed-Fi Project Templates Installer")]
[assembly: AssemblyCopyright("Copyright © Ed-Fi Alliance 2018")]
[assembly: AssemblyCopyright("Copyright © Ed-Fi Alliance 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
Loading
Loading