Skip to content

Commit

Permalink
Update java_dataset.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ajdesh2000 authored Sep 15, 2024
1 parent 827ced5 commit 4c7f30c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions repoclassbench/dataset/java_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ def __init__(self, specification: str, delete_relatives: bool) -> None:
self.data = json.load(open("data/input/java_data.json", "r"))
self._download_data()
## Extract jdk and maven


os.makedirs("external/java",exist_ok=True)

if not os.path.exists("external/java/jdk-17.0.6"):
if not os.path.exists("external/java/jdk-17.0.6.zip"):
data_url = "https://drive.google.com/uc?id=1HIJICJgQQvM_LzbSVRdBlQyiD_kY5BNc"
Expand All @@ -31,7 +33,7 @@ def __init__(self, specification: str, delete_relatives: bool) -> None:

if not os.path.exists("external/java/apache-maven-3.8.7"):
if not os.path.exists("external/java/apache-maven-3.8.7.zip"):
data_url = "https://drive.google.com/uc?id=1JFzF2oAzS8D31fhtpn3uIWhhWJTGG"
data_url = "https://drive.google.com/uc?id=1JFzF2oAzS8D31fhtpn3uIWhhWJTGG-5i"
gdown.download(data_url, "external/java/apache-maven-3.8.7.zip", quiet=False)
with zipfile.ZipFile(
"external/java/apache-maven-3.8.7.zip", "r"
Expand All @@ -49,6 +51,8 @@ def __init__(self, specification: str, delete_relatives: bool) -> None:
def _download_data(self) -> None:
if os.path.exists("temp/java/original_repo"):
return

os.makedirs("temp/java",exist_ok=True)

data_url = "https://drive.google.com/uc?id=16ZeWM_wKfeBfm7rvsBnksbVJZuLAZ1yo"
gdown.download(data_url, "temp/java/java_repos.zip", quiet=False)
Expand Down

0 comments on commit 4c7f30c

Please sign in to comment.