Skip to content
This repository was archived by the owner on Jan 14, 2023. It is now read-only.

Commit 96923a9

Browse files
committed
faster, copying across gradle to a new project.
1 parent 3444f5d commit 96923a9

File tree

6 files changed

+15
-181
lines changed

6 files changed

+15
-181
lines changed

src/genjava/gradle/Readme.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
This is not installed, but it gets used to generate the gradle wrapper for a project.
1+
This used to generate the gradle wrapper for a project. Simply untar it.
2+
When creating the tarball, simply run the following command in any gradle projects root.
23

3-
It is currently the gradle wrapper supporting gradle 1.9.
4+
> tar -cvzf gradle.tar.gz gradlew gradle gradlew.bat

src/genjava/gradle/gradle.tar.gz

48.1 KB
Binary file not shown.
-49.9 KB
Binary file not shown.

src/genjava/gradle/gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/genjava/gradle/gradlew

Lines changed: 0 additions & 164 deletions
This file was deleted.

src/genjava/gradle_project.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import os
1010
import shutil
1111

12-
# local imports
13-
#import utils
1412
from catkin_pkg.packages import find_packages
1513
import rospkg
1614

@@ -45,16 +43,21 @@ def author_name():
4543

4644

4745
import subprocess
46+
import tarfile
4847

4948

5049
def create_gradle_wrapper(repo_path):
51-
gradle_binary = os.path.join(os.path.dirname(__file__), 'gradle', 'gradlew')
52-
cmd = [gradle_binary, '-p', repo_path, 'wrapper']
53-
print("Creating gradle wrapper: %s" % ' '.join(cmd))
54-
try:
55-
subprocess.check_call(cmd)
56-
except subprocess.CalledProcessError:
57-
raise subprocess.CalledProcessError("failed to create the gradle wrapper.")
50+
archive_file = os.path.join(os.path.dirname(__file__), 'gradle', 'gradle.tar.gz')
51+
archive = tarfile.open(archive_file)
52+
archive.extractall(path=repo_path)
53+
archive.close()
54+
# gradle_binary = os.path.join(os.path.dirname(__file__), 'gradle', 'gradlew')
55+
# cmd = [gradle_binary, '-p', repo_path, 'wrapper']
56+
# print("Creating gradle wrapper: %s" % ' '.join(cmd))
57+
# try:
58+
# subprocess.check_call(cmd)
59+
# except subprocess.CalledProcessError:
60+
# raise subprocess.CalledProcessError("failed to create the gradle wrapper.")
5861

5962

6063
def read_template(tmplf):

0 commit comments

Comments
 (0)