Skip to content

Commit

Permalink
Merge pull request #25 from spdx/v3update2
Browse files Browse the repository at this point in the history
Update to SPDX Spec V3
  • Loading branch information
goneall authored Dec 21, 2024
2 parents 5bf9419 + ed8a1b6 commit 66f89ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spdx_license_matcher/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ def getListedLicense(licenseId):
dirpath = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
classpath = os.path.join(dirpath, "tool.jar")
jpype.startJVM(jpype.getDefaultJVMPath(), "-ea", "-Djava.class.path=%s"%classpath)

jpype.JPackage("org.spdx.library").SpdxModelFactory.init()
# Attach a Thread and start processing the request
jpype.attachThreadToJVM()
package = jpype.JPackage("org.spdx.library.model.license")
package = jpype.JPackage("org.spdx.library")
licenseinfofactoryclass = package.LicenseInfoFactory
try:

# Call the method getListedLicenseById present in the SPDX Tools
listed_license = licenseinfofactoryclass.getListedLicenseById(licenseId)
listed_license = licenseinfofactoryclass.getListedLicenseByIdCompatV2(licenseId)
jpype.detachThreadFromJVM()
return listed_license
except:
Expand All @@ -110,6 +110,7 @@ def checkTextStandardLicense(license, compareText):
dirpath = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
classpath = os.path.join(dirpath, "tool.jar")
jpype.startJVM(jpype.getDefaultJVMPath(), "-ea", "-Djava.class.path=%s"%classpath)
jpype.JPackage("org.spdx.library").SpdxModelFactory.init()

# Attach a Thread and start processing the request
jpype.attachThreadToJVM()
Expand Down
Binary file modified tool.jar
Binary file not shown.

0 comments on commit 66f89ad

Please sign in to comment.