# Copyright AllSeen Alliance. All rights reserved.
#
#    Permission to use, copy, modify, and/or distribute this software for any
#    purpose with or without fee is hereby granted, provided that the above
#    copyright notice and this permission notice appear in all copies.
#
#    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
#    WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
#    MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
#    ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
#    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
#    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
#    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Import('about_env')

if about_env.has_key('_ALLJOYN_JAVA_'):
    about_env.Append(JAVACLASSPATH = [ str(about_env.File('$DISTDIR/java/jar/alljoyn.jar')) ])
    about_env['dep_jars'] = [ '$DISTDIR/java/jar/alljoyn.jar' ]
else:
    about_env.Append(JAVACLASSPATH = [ str(about_env.File('$ALLJOYN_DISTDIR/java/jar/alljoyn.jar')) ])
    about_env['dep_jars'] = [ ]

# Since everything in the AboutService has been deprecated and many internal
# classes reference other classes we want to turn off the deprecation warning
# when building the java AboutService. A single warning it still printed
# letting us know we are using deprecated code. This is better than 100s of
# warnings across the AboutService code.
about_env.Append(JAVACFLAGS = ['-Xlint:-deprecation'])

jars = []
jars += about_env.SConscript('src/SConscript', exports = ['about_env']),

# Sample programs
jars += about_env.SConscript('samples/SConscript', exports = ['about_env'])

about_env.Install('$DISTDIR/java/jar', jars)
