makit 0.0.99 → 0.0.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +41 -0
- data/exe/makit +5 -0
- data/lib/makit/apache.rb +7 -11
- data/lib/makit/cli/build_commands.rb +500 -0
- data/lib/makit/cli/generators/base_generator.rb +74 -0
- data/lib/makit/cli/generators/dotnet_generator.rb +50 -0
- data/lib/makit/cli/generators/generator_factory.rb +49 -0
- data/lib/makit/cli/generators/node_generator.rb +50 -0
- data/lib/makit/cli/generators/ruby_generator.rb +77 -0
- data/lib/makit/cli/generators/rust_generator.rb +50 -0
- data/lib/makit/cli/generators/templates/dotnet_templates.rb +167 -0
- data/lib/makit/cli/generators/templates/node_templates.rb +161 -0
- data/lib/makit/cli/generators/templates/ruby/gemfile.rb +26 -0
- data/lib/makit/cli/generators/templates/ruby/gemspec.rb +40 -0
- data/lib/makit/cli/generators/templates/ruby/main_lib.rb +33 -0
- data/lib/makit/cli/generators/templates/ruby/rakefile.rb +35 -0
- data/lib/makit/cli/generators/templates/ruby/readme.rb +63 -0
- data/lib/makit/cli/generators/templates/ruby/test.rb +39 -0
- data/lib/makit/cli/generators/templates/ruby/test_helper.rb +29 -0
- data/lib/makit/cli/generators/templates/ruby/version.rb +29 -0
- data/lib/makit/cli/generators/templates/rust_templates.rb +128 -0
- data/lib/makit/cli/main.rb +48 -19
- data/lib/makit/cli/project_commands.rb +868 -0
- data/lib/makit/cli/repository_commands.rb +661 -0
- data/lib/makit/cli/utility_commands.rb +521 -0
- data/lib/makit/command_runner.rb +187 -128
- data/lib/makit/commands/compatibility.rb +365 -0
- data/lib/makit/commands/factory.rb +359 -0
- data/lib/makit/commands/middleware/base.rb +73 -0
- data/lib/makit/commands/middleware/cache.rb +248 -0
- data/lib/makit/commands/middleware/command_logger.rb +323 -0
- data/lib/makit/commands/middleware/unified_logger.rb +243 -0
- data/lib/makit/commands/middleware/validator.rb +269 -0
- data/lib/makit/commands/request.rb +254 -0
- data/lib/makit/commands/result.rb +323 -0
- data/lib/makit/commands/runner.rb +317 -0
- data/lib/makit/commands/strategies/base.rb +160 -0
- data/lib/makit/commands/strategies/synchronous.rb +134 -0
- data/lib/makit/commands.rb +24 -3
- data/lib/makit/configuration/gitlab_helper.rb +60 -0
- data/lib/makit/configuration/project.rb +127 -0
- data/lib/makit/configuration/rakefile_helper.rb +43 -0
- data/lib/makit/configuration/step.rb +34 -0
- data/lib/makit/configuration.rb +14 -0
- data/lib/makit/content/default_gitignore.rb +4 -2
- data/lib/makit/content/default_rakefile.rb +4 -2
- data/lib/makit/content/gem_rakefile.rb +4 -2
- data/lib/makit/context.rb +1 -0
- data/lib/makit/data.rb +9 -10
- data/lib/makit/directories.rb +48 -52
- data/lib/makit/directory.rb +38 -52
- data/lib/makit/docs/files.rb +5 -10
- data/lib/makit/docs/rake.rb +16 -20
- data/lib/makit/dotnet/cli.rb +65 -0
- data/lib/makit/dotnet/project.rb +153 -0
- data/lib/makit/dotnet/solution.rb +38 -0
- data/lib/makit/dotnet/solution_classlib.rb +239 -0
- data/lib/makit/dotnet/solution_console.rb +264 -0
- data/lib/makit/dotnet/solution_maui.rb +354 -0
- data/lib/makit/dotnet/solution_wasm.rb +275 -0
- data/lib/makit/dotnet/solution_wpf.rb +304 -0
- data/lib/makit/dotnet.rb +54 -171
- data/lib/makit/email.rb +46 -17
- data/lib/makit/environment.rb +22 -19
- data/lib/makit/examples/runner.rb +370 -0
- data/lib/makit/exceptions.rb +45 -0
- data/lib/makit/fileinfo.rb +3 -5
- data/lib/makit/files.rb +12 -16
- data/lib/makit/gems.rb +40 -39
- data/lib/makit/git/cli.rb +54 -0
- data/lib/makit/git/repository.rb +90 -0
- data/lib/makit/git.rb +44 -91
- data/lib/makit/gitlab_runner.rb +0 -1
- data/lib/makit/humanize.rb +31 -23
- data/lib/makit/indexer.rb +15 -24
- data/lib/makit/logging/configuration.rb +305 -0
- data/lib/makit/logging/format_registry.rb +84 -0
- data/lib/makit/logging/formatters/base.rb +39 -0
- data/lib/makit/logging/formatters/console_formatter.rb +127 -0
- data/lib/makit/logging/formatters/json_formatter.rb +65 -0
- data/lib/makit/logging/formatters/plain_text_formatter.rb +71 -0
- data/lib/makit/logging/formatters/text_formatter.rb +64 -0
- data/lib/makit/logging/log_request.rb +115 -0
- data/lib/makit/logging/logger.rb +159 -0
- data/lib/makit/logging/sinks/base.rb +91 -0
- data/lib/makit/logging/sinks/console.rb +72 -0
- data/lib/makit/logging/sinks/file_sink.rb +92 -0
- data/lib/makit/logging/sinks/structured.rb +129 -0
- data/lib/makit/logging/sinks/unified_file_sink.rb +303 -0
- data/lib/makit/logging.rb +452 -37
- data/lib/makit/markdown.rb +18 -18
- data/lib/makit/mp/basic_object_mp.rb +5 -4
- data/lib/makit/mp/command_mp.rb +5 -5
- data/lib/makit/mp/command_request.mp.rb +3 -2
- data/lib/makit/mp/project_mp.rb +85 -96
- data/lib/makit/mp/string_mp.rb +245 -73
- data/lib/makit/nuget.rb +27 -25
- data/lib/makit/port.rb +25 -27
- data/lib/makit/process.rb +127 -29
- data/lib/makit/protoc.rb +27 -24
- data/lib/makit/rake/cli.rb +196 -0
- data/lib/makit/rake.rb +6 -6
- data/lib/makit/ruby/cli.rb +185 -0
- data/lib/makit/ruby.rb +25 -0
- data/lib/makit/secrets.rb +18 -18
- data/lib/makit/serializer.rb +29 -27
- data/lib/makit/services/builder.rb +186 -0
- data/lib/makit/services/error_handler.rb +226 -0
- data/lib/makit/services/repository_manager.rb +229 -0
- data/lib/makit/services/validator.rb +112 -0
- data/lib/makit/setup/classlib.rb +53 -0
- data/lib/makit/setup/gem.rb +250 -0
- data/lib/makit/setup/runner.rb +40 -0
- data/lib/makit/show.rb +16 -16
- data/lib/makit/storage.rb +32 -37
- data/lib/makit/symbols.rb +12 -0
- data/lib/makit/task_hooks.rb +125 -0
- data/lib/makit/task_info.rb +63 -21
- data/lib/makit/tasks/at_exit.rb +13 -0
- data/lib/makit/tasks/build.rb +18 -0
- data/lib/makit/tasks/clean.rb +11 -0
- data/lib/makit/tasks/hook_manager.rb +239 -0
- data/lib/makit/tasks/init.rb +47 -0
- data/lib/makit/tasks/integrate.rb +15 -0
- data/lib/makit/tasks/pull_incoming.rb +12 -0
- data/lib/makit/tasks/setup.rb +6 -0
- data/lib/makit/tasks/sync.rb +11 -0
- data/lib/makit/tasks/task_monkey_patch.rb +79 -0
- data/lib/makit/tasks.rb +5 -150
- data/lib/makit/test_cache.rb +239 -0
- data/lib/makit/v1/makit.v1_pb.rb +34 -35
- data/lib/makit/v1/makit.v1_services_pb.rb +2 -0
- data/lib/makit/version.rb +1 -57
- data/lib/makit/wix.rb +23 -23
- data/lib/makit/yaml.rb +18 -6
- data/lib/makit.rb +2 -261
- metadata +109 -145
- data/lib/makit/cli/clean.rb +0 -14
- data/lib/makit/cli/clone.rb +0 -59
- data/lib/makit/cli/init.rb +0 -38
- data/lib/makit/cli/make.rb +0 -54
- data/lib/makit/cli/new.rb +0 -37
- data/lib/makit/cli/nuget_cache.rb +0 -38
- data/lib/makit/cli/pull.rb +0 -31
- data/lib/makit/cli/setup.rb +0 -71
- data/lib/makit/cli/work.rb +0 -21
- data/lib/makit/content/default_gitignore.txt +0 -222
| @@ -0,0 +1,354 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Makit
         | 
| 4 | 
            +
              class DotNet
         | 
| 5 | 
            +
                class SolutionMaui
         | 
| 6 | 
            +
                  def self.setup(name)
         | 
| 7 | 
            +
                    Makit::DotNet::Project.new_project("maui", name, "source/#{name}", "--framework net8.0")
         | 
| 8 | 
            +
                    Makit::DotNet::Project.new_project("TUnit", "#{name}.Tests", "tests/#{name}")
         | 
| 9 | 
            +
                    # Makit::DotNet::Project.add_reference("tests/#{name}/#{name}.Tests.csproj", "source/#{name}/#{name}.csproj")
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                    # Generate additional project files
         | 
| 12 | 
            +
                    generate_rakefile(name)
         | 
| 13 | 
            +
                    generate_gitlab_ci(name)
         | 
| 14 | 
            +
                  end
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                  def self.generate_rakefile(project_name)
         | 
| 17 | 
            +
                    rakefile_content = <<~RUBY
         | 
| 18 | 
            +
                      # frozen_string_literal: true
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                      require "makit"
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                      #
         | 
| 23 | 
            +
                      # #{project_name} MAUI Project Rakefile
         | 
| 24 | 
            +
                      #
         | 
| 25 | 
            +
                      desc "default task - builds and tests the MAUI project"
         | 
| 26 | 
            +
                      task :default => [:build, :test]
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                      desc "build the #{project_name} MAUI project"
         | 
| 29 | 
            +
                      task :build do
         | 
| 30 | 
            +
                        puts "Building #{project_name} MAUI project..."
         | 
| 31 | 
            +
                        project_path = "source/#{project_name}/#{project_name}.csproj"
         | 
| 32 | 
            +
                      #{"  "}
         | 
| 33 | 
            +
                        if File.exist?(project_path)
         | 
| 34 | 
            +
                          sh "dotnet build \#{project_path} --configuration Release"
         | 
| 35 | 
            +
                          puts "MAUI project build completed successfully!"
         | 
| 36 | 
            +
                        else
         | 
| 37 | 
            +
                          puts "Error: Project file not found at \#{project_path}"
         | 
| 38 | 
            +
                          exit 1
         | 
| 39 | 
            +
                        end
         | 
| 40 | 
            +
                      end
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                      desc "test the #{project_name} MAUI project"
         | 
| 43 | 
            +
                      task :test do
         | 
| 44 | 
            +
                        puts "Testing #{project_name} MAUI project..."
         | 
| 45 | 
            +
                        project_path = "source/#{project_name}/#{project_name}.csproj"
         | 
| 46 | 
            +
                      #{"  "}
         | 
| 47 | 
            +
                        if File.exist?(project_path)
         | 
| 48 | 
            +
                          sh "dotnet test \#{project_path} --configuration Release --verbosity normal"
         | 
| 49 | 
            +
                          puts "MAUI project tests completed successfully!"
         | 
| 50 | 
            +
                        else
         | 
| 51 | 
            +
                          puts "Error: Project file not found at \#{project_path}"
         | 
| 52 | 
            +
                          exit 1
         | 
| 53 | 
            +
                        end
         | 
| 54 | 
            +
                      end
         | 
| 55 | 
            +
             | 
| 56 | 
            +
                      desc "run the #{project_name} MAUI project on Android"
         | 
| 57 | 
            +
                      task :run_android => [:build] do
         | 
| 58 | 
            +
                        puts "Running #{project_name} MAUI project on Android..."
         | 
| 59 | 
            +
                        project_path = "source/#{project_name}/#{project_name}.csproj"
         | 
| 60 | 
            +
                      #{"  "}
         | 
| 61 | 
            +
                        if File.exist?(project_path)
         | 
| 62 | 
            +
                          sh "dotnet build \#{project_path} -t:Run -f net8.0-android"
         | 
| 63 | 
            +
                        else
         | 
| 64 | 
            +
                          puts "Error: Project file not found at \#{project_path}"
         | 
| 65 | 
            +
                          exit 1
         | 
| 66 | 
            +
                        end
         | 
| 67 | 
            +
                      end
         | 
| 68 | 
            +
             | 
| 69 | 
            +
                      desc "run the #{project_name} MAUI project on iOS"
         | 
| 70 | 
            +
                      task :run_ios => [:build] do
         | 
| 71 | 
            +
                        puts "Running #{project_name} MAUI project on iOS..."
         | 
| 72 | 
            +
                        project_path = "source/#{project_name}/#{project_name}.csproj"
         | 
| 73 | 
            +
                      #{"  "}
         | 
| 74 | 
            +
                        if File.exist?(project_path)
         | 
| 75 | 
            +
                          sh "dotnet build \#{project_path} -t:Run -f net8.0-ios"
         | 
| 76 | 
            +
                        else
         | 
| 77 | 
            +
                          puts "Error: Project file not found at \#{project_path}"
         | 
| 78 | 
            +
                          exit 1
         | 
| 79 | 
            +
                        end
         | 
| 80 | 
            +
                      end
         | 
| 81 | 
            +
             | 
| 82 | 
            +
                      desc "run the #{project_name} MAUI project on Windows"
         | 
| 83 | 
            +
                      task :run_windows => [:build] do
         | 
| 84 | 
            +
                        puts "Running #{project_name} MAUI project on Windows..."
         | 
| 85 | 
            +
                        project_path = "source/#{project_name}/#{project_name}.csproj"
         | 
| 86 | 
            +
                      #{"  "}
         | 
| 87 | 
            +
                        if File.exist?(project_path)
         | 
| 88 | 
            +
                          sh "dotnet build \#{project_path} -t:Run -f net8.0-windows10.0.19041.0"
         | 
| 89 | 
            +
                        else
         | 
| 90 | 
            +
                          puts "Error: Project file not found at \#{project_path}"
         | 
| 91 | 
            +
                          exit 1
         | 
| 92 | 
            +
                        end
         | 
| 93 | 
            +
                      end
         | 
| 94 | 
            +
             | 
| 95 | 
            +
                      desc "run the #{project_name} MAUI project on macOS"
         | 
| 96 | 
            +
                      task :run_macos => [:build] do
         | 
| 97 | 
            +
                        puts "Running #{project_name} MAUI project on macOS..."
         | 
| 98 | 
            +
                        project_path = "source/#{project_name}/#{project_name}.csproj"
         | 
| 99 | 
            +
                      #{"  "}
         | 
| 100 | 
            +
                        if File.exist?(project_path)
         | 
| 101 | 
            +
                          sh "dotnet build \#{project_path} -t:Run -f net8.0-maccatalyst"
         | 
| 102 | 
            +
                        else
         | 
| 103 | 
            +
                          puts "Error: Project file not found at \#{project_path}"
         | 
| 104 | 
            +
                          exit 1
         | 
| 105 | 
            +
                        end
         | 
| 106 | 
            +
                      end
         | 
| 107 | 
            +
             | 
| 108 | 
            +
                      desc "clean build artifacts"
         | 
| 109 | 
            +
                      task :clean do
         | 
| 110 | 
            +
                        puts "Cleaning MAUI project build artifacts..."
         | 
| 111 | 
            +
                        sh "dotnet clean source/#{project_name}/#{project_name}.csproj"
         | 
| 112 | 
            +
                        puts "Clean completed successfully!"
         | 
| 113 | 
            +
                      end
         | 
| 114 | 
            +
             | 
| 115 | 
            +
                      desc "restore packages"
         | 
| 116 | 
            +
                      task :restore do
         | 
| 117 | 
            +
                        puts "Restoring MAUI project packages..."
         | 
| 118 | 
            +
                        sh "dotnet restore source/#{project_name}/#{project_name}.csproj"
         | 
| 119 | 
            +
                        puts "Restore completed successfully!"
         | 
| 120 | 
            +
                      end
         | 
| 121 | 
            +
             | 
| 122 | 
            +
                      desc "publish the MAUI project for Android"
         | 
| 123 | 
            +
                      task :publish_android do
         | 
| 124 | 
            +
                        puts "Publishing #{project_name} MAUI project for Android..."
         | 
| 125 | 
            +
                        output_dir = "artifacts/publish/#{project_name}-android"
         | 
| 126 | 
            +
                        FileUtils.mkdir_p(output_dir)
         | 
| 127 | 
            +
                        sh "dotnet publish source/#{project_name}/#{project_name}.csproj --configuration Release --framework net8.0-android --output \#{output_dir}"
         | 
| 128 | 
            +
                        puts "Android publish completed successfully! Output: \#{output_dir}"
         | 
| 129 | 
            +
                      end
         | 
| 130 | 
            +
             | 
| 131 | 
            +
                      desc "publish the MAUI project for iOS"
         | 
| 132 | 
            +
                      task :publish_ios do
         | 
| 133 | 
            +
                        puts "Publishing #{project_name} MAUI project for iOS..."
         | 
| 134 | 
            +
                        output_dir = "artifacts/publish/#{project_name}-ios"
         | 
| 135 | 
            +
                        FileUtils.mkdir_p(output_dir)
         | 
| 136 | 
            +
                        sh "dotnet publish source/#{project_name}/#{project_name}.csproj --configuration Release --framework net8.0-ios --output \#{output_dir}"
         | 
| 137 | 
            +
                        puts "iOS publish completed successfully! Output: \#{output_dir}"
         | 
| 138 | 
            +
                      end
         | 
| 139 | 
            +
             | 
| 140 | 
            +
                      desc "publish the MAUI project for Windows"
         | 
| 141 | 
            +
                      task :publish_windows do
         | 
| 142 | 
            +
                        puts "Publishing #{project_name} MAUI project for Windows..."
         | 
| 143 | 
            +
                        output_dir = "artifacts/publish/#{project_name}-windows"
         | 
| 144 | 
            +
                        FileUtils.mkdir_p(output_dir)
         | 
| 145 | 
            +
                        sh "dotnet publish source/#{project_name}/#{project_name}.csproj --configuration Release --framework net8.0-windows10.0.19041.0 --output \#{output_dir}"
         | 
| 146 | 
            +
                        puts "Windows publish completed successfully! Output: \#{output_dir}"
         | 
| 147 | 
            +
                      end
         | 
| 148 | 
            +
             | 
| 149 | 
            +
                      desc "publish the MAUI project for macOS"
         | 
| 150 | 
            +
                      task :publish_macos do
         | 
| 151 | 
            +
                        puts "Publishing #{project_name} MAUI project for macOS..."
         | 
| 152 | 
            +
                        output_dir = "artifacts/publish/#{project_name}-macos"
         | 
| 153 | 
            +
                        FileUtils.mkdir_p(output_dir)
         | 
| 154 | 
            +
                        sh "dotnet publish source/#{project_name}/#{project_name}.csproj --configuration Release --framework net8.0-maccatalyst --output \#{output_dir}"
         | 
| 155 | 
            +
                        puts "macOS publish completed successfully! Output: \#{output_dir}"
         | 
| 156 | 
            +
                      end
         | 
| 157 | 
            +
             | 
| 158 | 
            +
                      desc "publish for all supported platforms"
         | 
| 159 | 
            +
                      task :publish_all => [:publish_android, :publish_ios, :publish_windows, :publish_macos] do
         | 
| 160 | 
            +
                        puts "All platform publishing completed successfully!"
         | 
| 161 | 
            +
                      end
         | 
| 162 | 
            +
                    RUBY
         | 
| 163 | 
            +
             | 
| 164 | 
            +
                    File.write("Rakefile", rakefile_content)
         | 
| 165 | 
            +
                  end
         | 
| 166 | 
            +
             | 
| 167 | 
            +
                  def self.generate_gitlab_ci(project_name)
         | 
| 168 | 
            +
                    gitlab_ci_content = <<~YAML
         | 
| 169 | 
            +
                      # #{project_name} MAUI Project GitLab CI/CD Pipeline
         | 
| 170 | 
            +
                      # frozen_string_literal: true
         | 
| 171 | 
            +
             | 
| 172 | 
            +
                      stages:
         | 
| 173 | 
            +
                        - build
         | 
| 174 | 
            +
                        - test
         | 
| 175 | 
            +
                        - publish
         | 
| 176 | 
            +
             | 
| 177 | 
            +
                      variables:
         | 
| 178 | 
            +
                        DOTNET_VERSION: "8.0.x"
         | 
| 179 | 
            +
                        PROJECT_PATH: "source/#{project_name}/#{project_name}.csproj"
         | 
| 180 | 
            +
                        BUILD_CONFIGURATION: "Release"
         | 
| 181 | 
            +
                        TEST_RESULTS_DIR: "test-results"
         | 
| 182 | 
            +
                        COVERAGE_DIR: "coverage"
         | 
| 183 | 
            +
                        PUBLISH_DIR: "artifacts/publish"
         | 
| 184 | 
            +
             | 
| 185 | 
            +
                      # Cache NuGet packages between jobs
         | 
| 186 | 
            +
                      cache:
         | 
| 187 | 
            +
                        paths:
         | 
| 188 | 
            +
                          - "**/bin/"
         | 
| 189 | 
            +
                          - "**/obj/"
         | 
| 190 | 
            +
                          - "**/packages/"
         | 
| 191 | 
            +
                          - "~/.nuget/packages/"
         | 
| 192 | 
            +
             | 
| 193 | 
            +
                      # Build job
         | 
| 194 | 
            +
                      build:
         | 
| 195 | 
            +
                        stage: build
         | 
| 196 | 
            +
                        image: mcr.microsoft.com/dotnet/sdk:8.0
         | 
| 197 | 
            +
                        script:
         | 
| 198 | 
            +
                          - echo "Building #{project_name} MAUI project..."
         | 
| 199 | 
            +
                          - dotnet --version
         | 
| 200 | 
            +
                          - dotnet restore $PROJECT_PATH
         | 
| 201 | 
            +
                          - dotnet build $PROJECT_PATH --configuration $BUILD_CONFIGURATION --no-restore
         | 
| 202 | 
            +
                          - echo "MAUI project build completed successfully!"
         | 
| 203 | 
            +
                        artifacts:
         | 
| 204 | 
            +
                          paths:
         | 
| 205 | 
            +
                            - "**/bin/"
         | 
| 206 | 
            +
                            - "**/obj/"
         | 
| 207 | 
            +
                          expire_in: 1 week
         | 
| 208 | 
            +
                          when: on_success
         | 
| 209 | 
            +
                        rules:
         | 
| 210 | 
            +
                          - if: $CI_PIPELINE_SOURCE == "merge_request_event"
         | 
| 211 | 
            +
                          - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
         | 
| 212 | 
            +
                          - if: $CI_COMMIT_TAG
         | 
| 213 | 
            +
             | 
| 214 | 
            +
                      # Test job
         | 
| 215 | 
            +
                      test:
         | 
| 216 | 
            +
                        stage: test
         | 
| 217 | 
            +
                        image: mcr.microsoft.com/dotnet/sdk:8.0
         | 
| 218 | 
            +
                        dependencies:
         | 
| 219 | 
            +
                          - build
         | 
| 220 | 
            +
                        script:
         | 
| 221 | 
            +
                          - echo "Testing #{project_name} MAUI project..."
         | 
| 222 | 
            +
                          - dotnet test $PROJECT_PATH --configuration $BUILD_CONFIGURATION --no-build --verbosity normal
         | 
| 223 | 
            +
                          - echo "MAUI project tests completed successfully!"
         | 
| 224 | 
            +
                        artifacts:
         | 
| 225 | 
            +
                          paths:
         | 
| 226 | 
            +
                            - $TEST_RESULTS_DIR/
         | 
| 227 | 
            +
                            - $COVERAGE_DIR/
         | 
| 228 | 
            +
                          reports:
         | 
| 229 | 
            +
                            junit: $TEST_RESULTS_DIR/*.xml
         | 
| 230 | 
            +
                          expire_in: 1 week
         | 
| 231 | 
            +
                          when: always
         | 
| 232 | 
            +
                        rules:
         | 
| 233 | 
            +
                          - if: $CI_PIPELINE_SOURCE == "merge_request_event"
         | 
| 234 | 
            +
                          - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
         | 
| 235 | 
            +
                          - if: $CI_COMMIT_TAG
         | 
| 236 | 
            +
             | 
| 237 | 
            +
                      # Publish Android job
         | 
| 238 | 
            +
                      publish_android:
         | 
| 239 | 
            +
                        stage: publish
         | 
| 240 | 
            +
                        image: mcr.microsoft.com/dotnet/sdk:8.0
         | 
| 241 | 
            +
                        dependencies:
         | 
| 242 | 
            +
                          - test
         | 
| 243 | 
            +
                        script:
         | 
| 244 | 
            +
                          - echo "Publishing #{project_name} MAUI project for Android..."
         | 
| 245 | 
            +
                          - mkdir -p $PUBLISH_DIR
         | 
| 246 | 
            +
                          - dotnet publish $PROJECT_PATH --configuration $BUILD_CONFIGURATION --framework net8.0-android --output $PUBLISH_DIR/#{project_name}-android
         | 
| 247 | 
            +
                          - echo "Android publish completed successfully!"
         | 
| 248 | 
            +
                        artifacts:
         | 
| 249 | 
            +
                          paths:
         | 
| 250 | 
            +
                            - $PUBLISH_DIR/#{project_name}-android/
         | 
| 251 | 
            +
                          expire_in: 1 month
         | 
| 252 | 
            +
                          when: on_success
         | 
| 253 | 
            +
                        rules:
         | 
| 254 | 
            +
                          - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
         | 
| 255 | 
            +
                          - if: $CI_COMMIT_TAG
         | 
| 256 | 
            +
             | 
| 257 | 
            +
                      # Publish iOS job
         | 
| 258 | 
            +
                      publish_ios:
         | 
| 259 | 
            +
                        stage: publish
         | 
| 260 | 
            +
                        image: mcr.microsoft.com/dotnet/sdk:8.0
         | 
| 261 | 
            +
                        dependencies:
         | 
| 262 | 
            +
                          - test
         | 
| 263 | 
            +
                        script:
         | 
| 264 | 
            +
                          - echo "Publishing #{project_name} MAUI project for iOS..."
         | 
| 265 | 
            +
                          - mkdir -p $PUBLISH_DIR
         | 
| 266 | 
            +
                          - dotnet publish $PROJECT_PATH --configuration $BUILD_CONFIGURATION --framework net8.0-ios --output $PUBLISH_DIR/#{project_name}-ios
         | 
| 267 | 
            +
                          - echo "iOS publish completed successfully!"
         | 
| 268 | 
            +
                        artifacts:
         | 
| 269 | 
            +
                          paths:
         | 
| 270 | 
            +
                            - $PUBLISH_DIR/#{project_name}-ios/
         | 
| 271 | 
            +
                          expire_in: 1 month
         | 
| 272 | 
            +
                          when: on_success
         | 
| 273 | 
            +
                        rules:
         | 
| 274 | 
            +
                          - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
         | 
| 275 | 
            +
                          - if: $CI_COMMIT_TAG
         | 
| 276 | 
            +
             | 
| 277 | 
            +
                      # Publish Windows job
         | 
| 278 | 
            +
                      publish_windows:
         | 
| 279 | 
            +
                        stage: publish
         | 
| 280 | 
            +
                        image: mcr.microsoft.com/dotnet/sdk:8.0
         | 
| 281 | 
            +
                        dependencies:
         | 
| 282 | 
            +
                          - test
         | 
| 283 | 
            +
                        script:
         | 
| 284 | 
            +
                          - echo "Publishing #{project_name} MAUI project for Windows..."
         | 
| 285 | 
            +
                          - mkdir -p $PUBLISH_DIR
         | 
| 286 | 
            +
                          - dotnet publish $PROJECT_PATH --configuration $BUILD_CONFIGURATION --framework net8.0-windows10.0.19041.0 --output $PUBLISH_DIR/#{project_name}-windows
         | 
| 287 | 
            +
                          - echo "Windows publish completed successfully!"
         | 
| 288 | 
            +
                        artifacts:
         | 
| 289 | 
            +
                          paths:
         | 
| 290 | 
            +
                            - $PUBLISH_DIR/#{project_name}-windows/
         | 
| 291 | 
            +
                          expire_in: 1 month
         | 
| 292 | 
            +
                          when: on_success
         | 
| 293 | 
            +
                        rules:
         | 
| 294 | 
            +
                          - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
         | 
| 295 | 
            +
                          - if: $CI_COMMIT_TAG
         | 
| 296 | 
            +
             | 
| 297 | 
            +
                      # Publish macOS job
         | 
| 298 | 
            +
                      publish_macos:
         | 
| 299 | 
            +
                        stage: publish
         | 
| 300 | 
            +
                        image: mcr.microsoft.com/dotnet/sdk:8.0
         | 
| 301 | 
            +
                        dependencies:
         | 
| 302 | 
            +
                          - test
         | 
| 303 | 
            +
                        script:
         | 
| 304 | 
            +
                          - echo "Publishing #{project_name} MAUI project for macOS..."
         | 
| 305 | 
            +
                          - mkdir -p $PUBLISH_DIR
         | 
| 306 | 
            +
                          - dotnet publish $PROJECT_PATH --configuration $BUILD_CONFIGURATION --framework net8.0-maccatalyst --output $PUBLISH_DIR/#{project_name}-macos
         | 
| 307 | 
            +
                          - echo "macOS publish completed successfully!"
         | 
| 308 | 
            +
                        artifacts:
         | 
| 309 | 
            +
                          paths:
         | 
| 310 | 
            +
                            - $PUBLISH_DIR/#{project_name}-macos/
         | 
| 311 | 
            +
                          expire_in: 1 month
         | 
| 312 | 
            +
                          when: on_success
         | 
| 313 | 
            +
                        rules:
         | 
| 314 | 
            +
                          - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
         | 
| 315 | 
            +
                          - if: $CI_COMMIT_TAG
         | 
| 316 | 
            +
             | 
| 317 | 
            +
                      # Code quality job (optional)
         | 
| 318 | 
            +
                      code_quality:
         | 
| 319 | 
            +
                        stage: test
         | 
| 320 | 
            +
                        image: mcr.microsoft.com/dotnet/sdk:8.0
         | 
| 321 | 
            +
                        dependencies:
         | 
| 322 | 
            +
                          - build
         | 
| 323 | 
            +
                        script:
         | 
| 324 | 
            +
                          - echo "Running code quality checks..."
         | 
| 325 | 
            +
                          - dotnet tool install --global dotnet-format
         | 
| 326 | 
            +
                          - dotnet format --verify-no-changes $PROJECT_PATH
         | 
| 327 | 
            +
                          - echo "Code quality checks completed!"
         | 
| 328 | 
            +
                        allow_failure: true
         | 
| 329 | 
            +
                        rules:
         | 
| 330 | 
            +
                          - if: $CI_PIPELINE_SOURCE == "merge_request_event"
         | 
| 331 | 
            +
                          - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
         | 
| 332 | 
            +
             | 
| 333 | 
            +
                      # Security scan job (optional)
         | 
| 334 | 
            +
                      security_scan:
         | 
| 335 | 
            +
                        stage: test
         | 
| 336 | 
            +
                        image: mcr.microsoft.com/dotnet/sdk:8.0
         | 
| 337 | 
            +
                        dependencies:
         | 
| 338 | 
            +
                          - build
         | 
| 339 | 
            +
                        script:
         | 
| 340 | 
            +
                          - echo "Running security scan..."
         | 
| 341 | 
            +
                          - dotnet tool install --global dotnet-outdated-tool
         | 
| 342 | 
            +
                          - dotnet outdated $PROJECT_PATH
         | 
| 343 | 
            +
                          - echo "Security scan completed!"
         | 
| 344 | 
            +
                        allow_failure: true
         | 
| 345 | 
            +
                        rules:
         | 
| 346 | 
            +
                          - if: $CI_PIPELINE_SOURCE == "merge_request_event"
         | 
| 347 | 
            +
                          - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
         | 
| 348 | 
            +
                    YAML
         | 
| 349 | 
            +
             | 
| 350 | 
            +
                    File.write(".gitlab-ci.yml", gitlab_ci_content)
         | 
| 351 | 
            +
                  end
         | 
| 352 | 
            +
                end
         | 
| 353 | 
            +
              end
         | 
| 354 | 
            +
            end
         | 
| @@ -0,0 +1,275 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Makit
         | 
| 4 | 
            +
              class DotNet
         | 
| 5 | 
            +
                class SolutionWasm
         | 
| 6 | 
            +
                  def self.setup(name)
         | 
| 7 | 
            +
                    Makit::DotNet::Project.new_project("blazorwasm", name, "source/#{name}", "--framework net8.0")
         | 
| 8 | 
            +
                    Makit::DotNet::Project.new_project("TUnit", "#{name}.Tests", "tests/#{name}")
         | 
| 9 | 
            +
                    Makit::DotNet::Project.add_reference("tests/#{name}/#{name}.Tests.csproj", "source/#{name}/#{name}.csproj")
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                    # Generate additional project files
         | 
| 12 | 
            +
                    generate_rakefile(name)
         | 
| 13 | 
            +
                    generate_gitlab_ci(name)
         | 
| 14 | 
            +
                  end
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                  def self.generate_rakefile(project_name)
         | 
| 17 | 
            +
                    rakefile_content = <<~RUBY
         | 
| 18 | 
            +
                      # frozen_string_literal: true
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                      require "makit"
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                      #
         | 
| 23 | 
            +
                      # #{project_name} WebAssembly Project Rakefile
         | 
| 24 | 
            +
                      #
         | 
| 25 | 
            +
                      desc "default task - builds and tests the WebAssembly project"
         | 
| 26 | 
            +
                      task :default => [:build, :test]
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                      desc "build the #{project_name} WebAssembly project"
         | 
| 29 | 
            +
                      task :build do
         | 
| 30 | 
            +
                        puts "Building #{project_name} WebAssembly project..."
         | 
| 31 | 
            +
                        project_path = "source/#{project_name}/#{project_name}.csproj"
         | 
| 32 | 
            +
                      #{"  "}
         | 
| 33 | 
            +
                        if File.exist?(project_path)
         | 
| 34 | 
            +
                          sh "dotnet build \#{project_path} --configuration Release"
         | 
| 35 | 
            +
                          puts "WebAssembly project build completed successfully!"
         | 
| 36 | 
            +
                        else
         | 
| 37 | 
            +
                          puts "Error: Project file not found at \#{project_path}"
         | 
| 38 | 
            +
                          exit 1
         | 
| 39 | 
            +
                        end
         | 
| 40 | 
            +
                      end
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                      desc "test the #{project_name} WebAssembly project"
         | 
| 43 | 
            +
                      task :test do
         | 
| 44 | 
            +
                        puts "Testing #{project_name} WebAssembly project..."
         | 
| 45 | 
            +
                        project_path = "source/#{project_name}/#{project_name}.csproj"
         | 
| 46 | 
            +
                      #{"  "}
         | 
| 47 | 
            +
                        if File.exist?(project_path)
         | 
| 48 | 
            +
                          sh "dotnet test \#{project_path} --configuration Release --verbosity normal"
         | 
| 49 | 
            +
                          puts "WebAssembly project tests completed successfully!"
         | 
| 50 | 
            +
                        else
         | 
| 51 | 
            +
                          puts "Error: Project file not found at \#{project_path}"
         | 
| 52 | 
            +
                          exit 1
         | 
| 53 | 
            +
                        end
         | 
| 54 | 
            +
                      end
         | 
| 55 | 
            +
             | 
| 56 | 
            +
                      desc "run the #{project_name} WebAssembly project in development mode"
         | 
| 57 | 
            +
                      task :run => [:build] do
         | 
| 58 | 
            +
                        puts "Running #{project_name} WebAssembly project..."
         | 
| 59 | 
            +
                        project_path = "source/#{project_name}/#{project_name}.csproj"
         | 
| 60 | 
            +
                      #{"  "}
         | 
| 61 | 
            +
                        if File.exist?(project_path)
         | 
| 62 | 
            +
                          sh "dotnet run --project \#{project_path} --configuration Debug"
         | 
| 63 | 
            +
                        else
         | 
| 64 | 
            +
                          puts "Error: Project file not found at \#{project_path}"
         | 
| 65 | 
            +
                          exit 1
         | 
| 66 | 
            +
                        end
         | 
| 67 | 
            +
                      end
         | 
| 68 | 
            +
             | 
| 69 | 
            +
                      desc "clean build artifacts"
         | 
| 70 | 
            +
                      task :clean do
         | 
| 71 | 
            +
                        puts "Cleaning WebAssembly project build artifacts..."
         | 
| 72 | 
            +
                        sh "dotnet clean source/#{project_name}/#{project_name}.csproj"
         | 
| 73 | 
            +
                        puts "Clean completed successfully!"
         | 
| 74 | 
            +
                      end
         | 
| 75 | 
            +
             | 
| 76 | 
            +
                      desc "restore packages"
         | 
| 77 | 
            +
                      task :restore do
         | 
| 78 | 
            +
                        puts "Restoring WebAssembly project packages..."
         | 
| 79 | 
            +
                        sh "dotnet restore source/#{project_name}/#{project_name}.csproj"
         | 
| 80 | 
            +
                        puts "Restore completed successfully!"
         | 
| 81 | 
            +
                      end
         | 
| 82 | 
            +
             | 
| 83 | 
            +
                      desc "publish the WebAssembly project"
         | 
| 84 | 
            +
                      task :publish do
         | 
| 85 | 
            +
                        puts "Publishing #{project_name} WebAssembly project..."
         | 
| 86 | 
            +
                        output_dir = "artifacts/publish/#{project_name}"
         | 
| 87 | 
            +
                        FileUtils.mkdir_p(output_dir)
         | 
| 88 | 
            +
                        sh "dotnet publish source/#{project_name}/#{project_name}.csproj --configuration Release --output \#{output_dir}"
         | 
| 89 | 
            +
                        puts "WebAssembly project publish completed successfully! Output: \#{output_dir}"
         | 
| 90 | 
            +
                      end
         | 
| 91 | 
            +
             | 
| 92 | 
            +
                      desc "serve the published WebAssembly project"
         | 
| 93 | 
            +
                      task :serve => [:publish] do
         | 
| 94 | 
            +
                        puts "Serving #{project_name} WebAssembly project..."
         | 
| 95 | 
            +
                        output_dir = "artifacts/publish/#{project_name}"
         | 
| 96 | 
            +
                      #{"  "}
         | 
| 97 | 
            +
                        if Dir.exist?(output_dir)
         | 
| 98 | 
            +
                          puts "Starting web server on http://localhost:8080"
         | 
| 99 | 
            +
                          puts "Press Ctrl+C to stop the server"
         | 
| 100 | 
            +
                          sh "cd \#{output_dir} && python3 -m http.server 8080"
         | 
| 101 | 
            +
                        else
         | 
| 102 | 
            +
                          puts "Error: Published output directory not found at \#{output_dir}"
         | 
| 103 | 
            +
                          exit 1
         | 
| 104 | 
            +
                        end
         | 
| 105 | 
            +
                      end
         | 
| 106 | 
            +
             | 
| 107 | 
            +
                      desc "build and deploy to GitHub Pages"
         | 
| 108 | 
            +
                      task :deploy_github_pages => [:publish] do
         | 
| 109 | 
            +
                        puts "Deploying #{project_name} to GitHub Pages..."
         | 
| 110 | 
            +
                        output_dir = "artifacts/publish/#{project_name}"
         | 
| 111 | 
            +
                      #{"  "}
         | 
| 112 | 
            +
                        if Dir.exist?(output_dir)
         | 
| 113 | 
            +
                          # Copy published files to docs directory for GitHub Pages
         | 
| 114 | 
            +
                          docs_dir = "docs"
         | 
| 115 | 
            +
                          FileUtils.rm_rf(docs_dir) if Dir.exist?(docs_dir)
         | 
| 116 | 
            +
                          FileUtils.cp_r(output_dir, docs_dir)
         | 
| 117 | 
            +
                      #{"    "}
         | 
| 118 | 
            +
                          puts "Files copied to \#{docs_dir} for GitHub Pages deployment"
         | 
| 119 | 
            +
                          puts "Commit and push changes to deploy to GitHub Pages"
         | 
| 120 | 
            +
                        else
         | 
| 121 | 
            +
                          puts "Error: Published output directory not found at \#{output_dir}"
         | 
| 122 | 
            +
                          exit 1
         | 
| 123 | 
            +
                        end
         | 
| 124 | 
            +
                      end
         | 
| 125 | 
            +
                    RUBY
         | 
| 126 | 
            +
             | 
| 127 | 
            +
                    File.write("Rakefile", rakefile_content)
         | 
| 128 | 
            +
                  end
         | 
| 129 | 
            +
             | 
| 130 | 
            +
                  def self.generate_gitlab_ci(project_name)
         | 
| 131 | 
            +
                    gitlab_ci_content = <<~YAML
         | 
| 132 | 
            +
                      # #{project_name} WebAssembly Project GitLab CI/CD Pipeline
         | 
| 133 | 
            +
                      # frozen_string_literal: true
         | 
| 134 | 
            +
             | 
| 135 | 
            +
                      stages:
         | 
| 136 | 
            +
                        - build
         | 
| 137 | 
            +
                        - test
         | 
| 138 | 
            +
                        - publish
         | 
| 139 | 
            +
                        - deploy
         | 
| 140 | 
            +
             | 
| 141 | 
            +
                      variables:
         | 
| 142 | 
            +
                        DOTNET_VERSION: "8.0.x"
         | 
| 143 | 
            +
                        PROJECT_PATH: "source/#{project_name}/#{project_name}.csproj"
         | 
| 144 | 
            +
                        BUILD_CONFIGURATION: "Release"
         | 
| 145 | 
            +
                        TEST_RESULTS_DIR: "test-results"
         | 
| 146 | 
            +
                        COVERAGE_DIR: "coverage"
         | 
| 147 | 
            +
                        PUBLISH_DIR: "artifacts/publish"
         | 
| 148 | 
            +
             | 
| 149 | 
            +
                      # Cache NuGet packages between jobs
         | 
| 150 | 
            +
                      cache:
         | 
| 151 | 
            +
                        paths:
         | 
| 152 | 
            +
                          - "**/bin/"
         | 
| 153 | 
            +
                          - "**/obj/"
         | 
| 154 | 
            +
                          - "**/packages/"
         | 
| 155 | 
            +
                          - "~/.nuget/packages/"
         | 
| 156 | 
            +
             | 
| 157 | 
            +
                      # Build job
         | 
| 158 | 
            +
                      build:
         | 
| 159 | 
            +
                        stage: build
         | 
| 160 | 
            +
                        image: mcr.microsoft.com/dotnet/sdk:8.0
         | 
| 161 | 
            +
                        script:
         | 
| 162 | 
            +
                          - echo "Building #{project_name} WebAssembly project..."
         | 
| 163 | 
            +
                          - dotnet --version
         | 
| 164 | 
            +
                          - dotnet restore $PROJECT_PATH
         | 
| 165 | 
            +
                          - dotnet build $PROJECT_PATH --configuration $BUILD_CONFIGURATION --no-restore
         | 
| 166 | 
            +
                          - echo "WebAssembly project build completed successfully!"
         | 
| 167 | 
            +
                        artifacts:
         | 
| 168 | 
            +
                          paths:
         | 
| 169 | 
            +
                            - "**/bin/"
         | 
| 170 | 
            +
                            - "**/obj/"
         | 
| 171 | 
            +
                          expire_in: 1 week
         | 
| 172 | 
            +
                          when: on_success
         | 
| 173 | 
            +
                        rules:
         | 
| 174 | 
            +
                          - if: $CI_PIPELINE_SOURCE == "merge_request_event"
         | 
| 175 | 
            +
                          - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
         | 
| 176 | 
            +
                          - if: $CI_COMMIT_TAG
         | 
| 177 | 
            +
             | 
| 178 | 
            +
                      # Test job
         | 
| 179 | 
            +
                      test:
         | 
| 180 | 
            +
                        stage: test
         | 
| 181 | 
            +
                        image: mcr.microsoft.com/dotnet/sdk:8.0
         | 
| 182 | 
            +
                        dependencies:
         | 
| 183 | 
            +
                          - build
         | 
| 184 | 
            +
                        script:
         | 
| 185 | 
            +
                          - echo "Testing #{project_name} WebAssembly project..."
         | 
| 186 | 
            +
                          - dotnet test $PROJECT_PATH --configuration $BUILD_CONFIGURATION --no-build --verbosity normal
         | 
| 187 | 
            +
                          - echo "WebAssembly project tests completed successfully!"
         | 
| 188 | 
            +
                        artifacts:
         | 
| 189 | 
            +
                          paths:
         | 
| 190 | 
            +
                            - $TEST_RESULTS_DIR/
         | 
| 191 | 
            +
                            - $COVERAGE_DIR/
         | 
| 192 | 
            +
                          reports:
         | 
| 193 | 
            +
                            junit: $TEST_RESULTS_DIR/*.xml
         | 
| 194 | 
            +
                          expire_in: 1 week
         | 
| 195 | 
            +
                          when: always
         | 
| 196 | 
            +
                        rules:
         | 
| 197 | 
            +
                          - if: $CI_PIPELINE_SOURCE == "merge_request_event"
         | 
| 198 | 
            +
                          - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
         | 
| 199 | 
            +
                          - if: $CI_COMMIT_TAG
         | 
| 200 | 
            +
             | 
| 201 | 
            +
                      # Publish job
         | 
| 202 | 
            +
                      publish:
         | 
| 203 | 
            +
                        stage: publish
         | 
| 204 | 
            +
                        image: mcr.microsoft.com/dotnet/sdk:8.0
         | 
| 205 | 
            +
                        dependencies:
         | 
| 206 | 
            +
                          - test
         | 
| 207 | 
            +
                        script:
         | 
| 208 | 
            +
                          - echo "Publishing #{project_name} WebAssembly project..."
         | 
| 209 | 
            +
                          - mkdir -p $PUBLISH_DIR
         | 
| 210 | 
            +
                          - dotnet publish $PROJECT_PATH --configuration $BUILD_CONFIGURATION --output $PUBLISH_DIR/#{project_name}
         | 
| 211 | 
            +
                          - echo "WebAssembly project publish completed successfully!"
         | 
| 212 | 
            +
                        artifacts:
         | 
| 213 | 
            +
                          paths:
         | 
| 214 | 
            +
                            - $PUBLISH_DIR/
         | 
| 215 | 
            +
                          expire_in: 1 month
         | 
| 216 | 
            +
                          when: on_success
         | 
| 217 | 
            +
                        rules:
         | 
| 218 | 
            +
                          - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
         | 
| 219 | 
            +
                          - if: $CI_COMMIT_TAG
         | 
| 220 | 
            +
             | 
| 221 | 
            +
                      # Deploy to GitLab Pages
         | 
| 222 | 
            +
                      deploy_pages:
         | 
| 223 | 
            +
                        stage: deploy
         | 
| 224 | 
            +
                        image: alpine:latest
         | 
| 225 | 
            +
                        dependencies:
         | 
| 226 | 
            +
                          - publish
         | 
| 227 | 
            +
                        script:
         | 
| 228 | 
            +
                          - echo "Deploying #{project_name} to GitLab Pages..."
         | 
| 229 | 
            +
                          - apk add --no-cache rsync
         | 
| 230 | 
            +
                          - rsync -av $PUBLISH_DIR/#{project_name}/ public/
         | 
| 231 | 
            +
                          - echo "Deployment to GitLab Pages completed!"
         | 
| 232 | 
            +
                        artifacts:
         | 
| 233 | 
            +
                          paths:
         | 
| 234 | 
            +
                            - public
         | 
| 235 | 
            +
                        rules:
         | 
| 236 | 
            +
                          - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
         | 
| 237 | 
            +
             | 
| 238 | 
            +
                      # Code quality job (optional)
         | 
| 239 | 
            +
                      code_quality:
         | 
| 240 | 
            +
                        stage: test
         | 
| 241 | 
            +
                        image: mcr.microsoft.com/dotnet/sdk:8.0
         | 
| 242 | 
            +
                        dependencies:
         | 
| 243 | 
            +
                          - build
         | 
| 244 | 
            +
                        script:
         | 
| 245 | 
            +
                          - echo "Running code quality checks..."
         | 
| 246 | 
            +
                          - dotnet tool install --global dotnet-format
         | 
| 247 | 
            +
                          - dotnet format --verify-no-changes $PROJECT_PATH
         | 
| 248 | 
            +
                          - echo "Code quality checks completed!"
         | 
| 249 | 
            +
                        allow_failure: true
         | 
| 250 | 
            +
                        rules:
         | 
| 251 | 
            +
                          - if: $CI_PIPELINE_SOURCE == "merge_request_event"
         | 
| 252 | 
            +
                          - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
         | 
| 253 | 
            +
             | 
| 254 | 
            +
                      # Security scan job (optional)
         | 
| 255 | 
            +
                      security_scan:
         | 
| 256 | 
            +
                        stage: test
         | 
| 257 | 
            +
                        image: mcr.microsoft.com/dotnet/sdk:8.0
         | 
| 258 | 
            +
                        dependencies:
         | 
| 259 | 
            +
                          - build
         | 
| 260 | 
            +
                        script:
         | 
| 261 | 
            +
                          - echo "Running security scan..."
         | 
| 262 | 
            +
                          - dotnet tool install --global dotnet-outdated-tool
         | 
| 263 | 
            +
                          - dotnet outdated $PROJECT_PATH
         | 
| 264 | 
            +
                          - echo "Security scan completed!"
         | 
| 265 | 
            +
                        allow_failure: true
         | 
| 266 | 
            +
                        rules:
         | 
| 267 | 
            +
                          - if: $CI_PIPELINE_SOURCE == "merge_request_event"
         | 
| 268 | 
            +
                          - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
         | 
| 269 | 
            +
                    YAML
         | 
| 270 | 
            +
             | 
| 271 | 
            +
                    File.write(".gitlab-ci.yml", gitlab_ci_content)
         | 
| 272 | 
            +
                  end
         | 
| 273 | 
            +
                end
         | 
| 274 | 
            +
              end
         | 
| 275 | 
            +
            end
         |