Skip to content

Commit d230a9c

Browse files
Move scripts out of java jar
1 parent 993e6df commit d230a9c

File tree

465 files changed

+122
-19
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

465 files changed

+122
-19
lines changed

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
hs_err_pid*
2424
replay_pid*
2525
/target/
26+
# the final jar artifact is placed in the root of the project
27+
/core-*.jar
2628
.DS_Store
2729
.project
2830
/.settings/
@@ -31,3 +33,14 @@ replay_pid*
3133

3234
.idea
3335
/dependency-reduced-pom.xml
36+
37+
# python
38+
__pycache__/
39+
*.pyc
40+
.venv/
41+
42+
# test html reports
43+
*.html~
44+
45+
# app properties that contains credentials
46+
/application.properties

README.md

Lines changed: 74 additions & 0 deletions

application.properties.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
spring.datasource.url=jdbc:mysql://localhost:3306/cbioportal?useSSL=false
2+
spring.datasource.username=cbio
3+
spring.datasource.password=P@ssword1
4+
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
5+
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect

pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,13 @@
323323
</execution>
324324
</executions>
325325
</plugin>
326+
<plugin>
327+
<groupId>org.apache.maven.plugins</groupId>
328+
<artifactId>maven-jar-plugin</artifactId>
329+
<configuration>
330+
<outputDirectory>${project.basedir}</outputDirectory>
331+
</configuration>
332+
</plugin>
326333
</plugins>
327334
</build>
328335

File renamed without changes.
File renamed without changes.

src/main/resources/scripts/env.pl renamed to scripts/env.pl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@
3939
}
4040

4141
# Set up Classpath to use the scripts jar
42-
sub locate_src_root {
42+
sub locate_root {
4343
# isolate the directory this code file is in
4444
my ($volume, $script_dir, undef) = File::Spec->splitpath(__FILE__);
45-
# go up from cbioportal/core/src/main/scripts/ to cbioportal/
46-
my $src_root_dir = File::Spec->catdir($script_dir, (File::Spec->updir()) x 4);
45+
# go up one level
46+
my $root_dir = File::Spec->catdir($script_dir, File::Spec->updir());
4747
# reassamble the path and resolve updirs (/../)
48-
return abs_path(File::Spec->catpath($volume, $src_root_dir));
48+
return abs_path(File::Spec->catpath($volume, $root_dir));
4949
}
50-
$src_root = locate_src_root();
51-
@jar_files = glob("$src_root/scripts/target/scripts-*.jar");
50+
$root_dir = locate_root();
51+
@jar_files = glob("$root_dir/core-*.jar");
5252
if (scalar @jar_files != 1) {
53-
die "Expected to find 1 scripts-*.jar, but found: " . scalar @jar_files;
53+
die "Expected to find 1 core-*.jar, but found: " . scalar @jar_files;
5454
}
5555
$cp = pop @jar_files;
5656

File renamed without changes.

src/main/resources/scripts/envSimple.pl renamed to scripts/envSimple.pl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@
3434
}
3535

3636
# Set up Classpath to use the scripts jar
37-
sub locate_src_root {
37+
sub locate_root {
3838
# isolate the directory this code file is in
3939
my ($volume, $script_dir, undef) = File::Spec->splitpath(__FILE__);
40-
# go up from cbioportal/core/src/main/scripts/ to cbioportal/
41-
my $src_root_dir = File::Spec->catdir($script_dir, (File::Spec->updir()) x 1);
40+
# go up one level
41+
my $root_dir = File::Spec->catdir($script_dir, File::Spec->updir());
4242
# reassamble the path and resolve updirs (/../)
43-
return abs_path(File::Spec->catpath($volume, $src_root_dir));
43+
return abs_path(File::Spec->catpath($volume, $root_dir));
4444
}
45-
$src_root = locate_src_root();
46-
@jar_files = glob("$src_root/core-*.jar");
45+
$root_dir = locate_root();
46+
@jar_files = glob("$root_dir/core-*.jar");
4747
if (scalar @jar_files != 1) {
48-
die "Expected to find 1 scripts-*.jar, but found: " . scalar @jar_files;
48+
die "Expected to find 1 core-*.jar, but found: " . scalar @jar_files;
4949
}
5050
$cp = pop @jar_files;
5151

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/main/resources/scripts/importer/cbioportalImporter.py renamed to scripts/importer/cbioportalImporter.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,10 +498,11 @@ def locate_jar():
498498
"""
499499
# get the directory name of the currently running script,
500500
# resolving any symlinks
501-
script_dir = Path(__file__).resolve().parent
502-
# go up from core/scripts/importer/ to core/
503-
src_root = script_dir.parent.parent
504-
jars = list((src_root ).glob('core-*.jar'))
501+
this_file = Path(__file__).resolve()
502+
importer_dir = this_file.parent
503+
scripts_dir = importer_dir.parent
504+
root_dir = scripts_dir.parent
505+
jars = list((root_dir).glob('core-*.jar'))
505506
if len(jars) != 1:
506507
raise FileNotFoundError(
507508
'Expected to find 1 scripts-*.jar, but found ' + str(len(jars)))

src/main/resources/scripts/importer/cbioportal_common.py renamed to scripts/importer/cbioportal_common.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,9 @@ def run_java(*args):
997997
java_command = os.path.join(java_home, 'bin', 'java')
998998
else:
999999
java_command = 'java'
1000-
process = Popen([java_command] + list(args), stdout=PIPE, stderr=STDOUT,
1000+
full_cmd = [java_command] + list(args)
1001+
print(">", " ".join(full_cmd))
1002+
process = Popen(full_cmd, stdout=PIPE, stderr=STDOUT,
10011003
universal_newlines=True)
10021004
ret = []
10031005
while process.poll() is None:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

test_scripts.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pushd tests/; PYTHONPATH=../scripts:$PYTHONPATH python -m unittest *.py; popd

0 commit comments

Comments
 (0)