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 have this piece of code that does not work: public CartaoCidadao() { InitializeComponent();
I have this piece of code that works fine in subsonic 2.2, I migrated
I have a piece of code that load a very big image in memory.
I have a piece of code that takes several rows from a database and
I have a piece of code that look similar to this: <xsl:choose> <xsl:when test=some_test>
I’ve had this problem many times: I have a piece of source code, but
I have a piece of NSString that will read Test & Test or with
I have a piece of code with a) which I replaced with b) purely
I have a piece of my query in Oracle that generates discrete percentile: ...
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.