def create_conandata_yml_text(new_version: Version, single_header_sha: str,
                                  licence_file_sha: str) -> str:
        new_version_with_v = new_version.get_version_text()
        conan_data = \
            F'''  {new_version.get_version_text_without_v()}:
    - url: https://github.com/approvals/ApprovalTests.cpp/releases/download/{new_version_with_v}/ApprovalTests.{new_version_with_v}.hpp
      sha256: {single_header_sha}
    - url: "https://raw.githubusercontent.com/approvals/ApprovalTests.cpp/{new_version_with_v}/LICENSE"
      sha256: {licence_file_sha}
'''
        return conan_data
Example #2
0
    def create_conandata_yml_text(project_details: ProjectDetails, new_version: Version, single_header_sha: str,
                                  licence_file_sha: str) -> str:
        new_version_with_v = new_version.get_version_text()
        conan_data = \
            F'''  {new_version.get_version_text_without_v()}:
    - url: {project_details.github_project_url}/releases/download/{new_version_with_v}/{project_details.library_folder_name}.{new_version_with_v}.hpp
      sha256: {single_header_sha}
    - url: "https://raw.githubusercontent.com/approvals/{project_details.github_project_name}/{new_version_with_v}/LICENSE"
      sha256: {licence_file_sha}
'''
        return conan_data
Example #3
0
 def create_portfile_cmake_text(new_version: Version,
                                single_header_sha: str,
                                licence_file_sha: str) -> str:
     new_version_with_v = new_version.get_version_text()
     vcpkg_data = remove_indentation_from(F'''
                     vcpkg_download_distfile(single_header
                         URLS https://github.com/approvals/ApprovalTests.cpp/releases/download/{new_version_with_v}/ApprovalTests.{new_version_with_v}.hpp
                         FILENAME ApprovalTests.{new_version_with_v}.hpp
                         SHA512 {single_header_sha}
                     )
                     
                     vcpkg_download_distfile(license_file
                         URLS https://raw.githubusercontent.com/approvals/ApprovalTests.cpp/{new_version_with_v}/LICENSE
                         FILENAME ApprovalTestsLicense.{new_version_with_v}
                         SHA512 {licence_file_sha}
                     )
                     
                     file(INSTALL "${{single_header}}" DESTINATION "${{CURRENT_PACKAGES_DIR}}/include" RENAME ApprovalTests.hpp)
                     file(INSTALL "${{license_file}}" DESTINATION "${{CURRENT_PACKAGES_DIR}}/share/${{PORT}}" RENAME copyright)
                     ''')
     return vcpkg_data
Example #4
0
 def test_create_version(self) -> None:
     version = Version(2, 3, 4)
     self.assertEqual('v.2.3.4', version.get_version_text())