fun toEntity()

in core/package/src/main/kotlin/io/klibs/core/pckg/dto/PackageDTO.kt [41:73]


    fun toEntity(): PackageEntity {
        val entity = PackageEntity(
            id = id,
            projectId = projectId,
            repo = repo,
            groupId = groupId,
            artifactId = artifactId,
            version = version,
            releaseTs = releaseTs,
            name = name,
            description = description,
            url = url,
            scmUrl = scmUrl,
            buildTool = buildTool,
            buildToolVersion = buildToolVersion,
            kotlinVersion = kotlinVersion,
            developers = developers,
            licenses = licenses,
            configuration = configuration,
            generatedDescription = generatedDescription
        )

        // Add targets to the entity
        targets.forEach { target ->
            val targetEntity = PackageTargetEntity(
                platform = target.platform,
                target = target.target
            )
            entity.addTarget(targetEntity)
        }

        return entity
    }