summaryrefslogtreecommitdiffstats
path: root/make/scripts/check-java-major-version.sh
blob: fc9f53c813d4ce208ece18de18ee3a8bbcfa1ffc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /bin/bash

TDIR=`pwd`

function dump_version() {
    echo -n "$1: "
    javap -v $1 | grep 'major version'
}

function dump_versions() {
    cd $1
    #dump_version jogamp.common.Debug
    javap -v `find . -name '*.class'` | grep -e '^Classfile' -e 'major version'
    #for i in `find . -name '*.class'` ; do 
    #  dump_version `echo $i | sed -e 's/^\.\///g' -e 's/\//./g' -e 's/\.class//g'`
    #done
    cd $TDIR
}

function do_it() {
    dump_versions $1/classes
    dump_versions $1/test/build/classes
}

do_it $1 2>&1 | tee check-java-major-version.log
echo 
echo VERSIONS found:
echo
grep 'major version' check-java-major-version.log | sort -u