Sha256: 02137020a8d5dc49f5f77cb88f60353d4a5babf062ef8ae7c3c3559680491e96

Contents?: true

Size: 1.93 KB

Versions: 15

Compression:

Stored size: 1.93 KB

Contents

class ProjectFileSystemValidator

    def initialize
        @project_root = SolaraSettingsManager.instance.project_root
        @platform = SolaraSettingsManager.instance.platform
    end

    def validate
        file_system = project_filesystem
        manager = InteractiveFileSystemValidator.new(@project_root, ProjectSettingsManager.instance)
        manager.start(file_system)
    end

    def project_filesystem
        case @platform
        when Platform::Flutter
            android_file_system + ios_file_system
        when Platform::IOS
            ios_file_system
        when Platform::Android
            android_file_system
        else
            raise ArgumentError, "Invalid platform: #{@platform}"
        end
    end

    def android_file_system
        [
            {
                name: FilePath.gradle_name,
                path: File.join(FilePath.android_project_relative_root),
                key: 'build.gradle',
                type: 'file',
                recursive: false,
                platform: Platform::Android
            },
            {
                name: FilePath.gradle_name,
                path: File.join(FilePath.android_project_relative_root, 'app'),
                key: 'app/build.gradle',
                type: 'file',
                recursive: false,
                platform: Platform::Android,
            }
        ]
    end

    def ios_file_system
        [
            {
                name: '*.xcodeproj',
                key: 'xcodeproj',
                type: 'folder',
                platform: Platform::IOS,
            },
            {
                name: 'Assets.xcassets',
                key: 'Assets.xcassets',
                type: 'folder',
                platform: Platform::IOS,
            },
            {
                name: 'Info.plist',
                key: 'Info.plist',
                type: 'file',
                platform: Platform::IOS,
            }
        ]
    end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
solara-0.7.4 solara/lib/core/doctor/validator/project_filesystem_validator.rb
solara-0.7.3 solara/lib/core/doctor/validator/project_filesystem_validator.rb
solara-0.7.2 solara/lib/core/doctor/validator/project_filesystem_validator.rb
solara-0.7.1 solara/lib/core/doctor/validator/project_filesystem_validator.rb
solara-0.7.0 solara/lib/core/doctor/validator/project_filesystem_validator.rb
solara-0.6.0 solara/lib/core/doctor/validator/project_filesystem_validator.rb
solara-0.5.0 solara/lib/core/doctor/validator/project_filesystem_validator.rb
solara-0.4.0 solara/lib/core/doctor/validator/project_filesystem_validator.rb
solara-0.3.0 solara/lib/core/doctor/validator/project_filesystem_validator.rb
solara-0.2.4 solara/lib/core/doctor/validator/project_filesystem_validator.rb
solara-0.2.3 solara/lib/core/doctor/validator/project_filesystem_validator.rb
solara-0.2.2 solara/lib/core/doctor/validator/project_filesystem_validator.rb
solara-0.2.1 solara/lib/core/doctor/validator/project_filesystem_validator.rb
solara-0.2.0 solara/lib/core/doctor/validator/project_filesystem_validator.rb
solara-0.1.0 solara/lib/core/doctor/validator/project_filesystem_validator.rb