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

  • SEARCH
  • Home
  • 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 have a piece of code (below) that can get the text of an
I have a piece of code that I can run in four ways Debug
I have a piece of code that was written by someone else before the
I have a piece of Python code that is supposed to open a new
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 the following piece of code that checks if the returned video object
Here I have piece of code, showing example of how I want to update
I have a piece of code like this: <div id=container runat=server> <div id=parent runat=server>
I have this piece of code in a function. I want to print the

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.