Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7889039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:59:37+00:00 2026-06-03T05:59:37+00:00

I have a piece of source code in our build that is generated by

  • 0

I have a piece of source code in our build that is generated by running a java class.

I can’t for the life of me work out how to instruct scons on the dependency, and it keeps trying to build the source code before it builds the .class file.

When I do o = env.Java(target = ‘target_dir’, source = Dir(‘source_dir’)), o is set to an empty list.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:59:39+00:00Added an answer on June 3, 2026 at 5:59 am

    You can use the Depends() function for that, something like this:

    o = env.Java(target = 'target_dir', source = Dir('source_dir'))
    env.Depends(o, 'the_generated_file_and_path')
    

    Here is a better option (since you dont have to worry about the gen’d file path when calling Depends()), assuming you are executing said java class with the SCons Command() function:

    # $SOURCE and $TARGET will be filled in by SCons Command, $SOURCE is optional
    cmdLine = 'theCommand $SOURCE $TARGET'
    
    genTarget = env.Command(target = [list output files here],
                            source = 'java_class_executed',
                            action = cmdLine)
    ...
    o = env.Java(...)
    env.Depends(o, genTarget)
    

    Regarding o being an empty list, is it always an empty list? If so, be careful how you specify the source, it should be the root of the package dir structure. For example, if your dir tree is something like this:

    .
    |-- SConstruct
    `-- src
       `-- com
           `-- tanner
               `-- application
                   `-- main.java
    

    You should specify the source dir as follows: '#/src/com'

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’ve had this problem many times: I have a piece of source code, but
I have a piece of software that I would like to open source via
I have piece of JavaScript code which cycles through form elements and builds an
I have a piece of C code as below which crashes at the calloc()
I have a piece of code written in PHP inside my javascript tag. I
I have a piece of server-ish software written in Java to run on Windows
I have this piece of code (summarized)... AnsiString working(AnsiString format,...) { va_list argptr; AnsiString
I have a piece of XML that is structured similar to this: <root> <score
I have this piece of Javascript and it just won't work. I allready checked
I need to create a porting software that will convert Java code to C#

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.