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 670079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:13:24+00:00 2026-05-14T00:13:24+00:00

I want to create an Action to automate GCJ compilation. Since I couldn’t make

  • 0

I want to create an Action to automate GCJ compilation. Since I couldn’t make it work with Ant, I decided to try SBT. The docs say how to create an Action and how to run an external process. What I don’t yet see is how to reuse the directory tree traversal which exists for java and scala compiler Actions. In this case my input files would be all the .class files under a certain root folder. I would also need to specify a specific classpath for GCJ. Any pointers for this would be appreciated too.

  • 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-05-14T00:13:24+00:00Added an answer on May 14, 2026 at 12:13 am

    I haven’t used GCJ much at all and I’m still pretty new at SBT, but this is how I believe you could write a quick task to do exactly what you are looking for with SBT 0.7.1. You can use a PathFinder to grab all of the class files like so:

    val allClasses = (outputPath ##) ** "*.class"
    

    Using that PathFinder and the “compileClasspath” top level method, you can construct a task like this which will run gcj using the current project’s classpath and compose all of the .class files into one gcjFile:

    val gcj = "/usr/local/bin/gcj"
    val gcjFile = "target/my_executable.o"
    
    val allClasses = (outputPath ##) ** "*.class"
    
    lazy val gcjCompile = execTask {
      <x>{gcj} --classpath={compileClasspath.get.map(_.absolutePath).mkString(":")}  -c {allClasses.get.map(_.absolutePath).mkString("-c ")} -o {gcjFile}</x>
    } dependsOn(compile) describedAs("Create a GCJ executable object")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a dashboard page with on top a create action (form)
I created a UIButton programmatically and I want to create an action to handle
I want to create a logout action in JSPs such that there is no
I want to create a switching button with movable action like if it's showing
I want to create a button which when clicked calls an action. I have
I want to create an application that performs a particular action when the device
i want to create a NFC SmartPoster which dial a number with Action Record
I have an action which create QMessageBox. In that dialog I want to print
I have controller with action new , and I want it to create ActiveRecord::Base
I want to create Action Bar like this I saw in Dev guide that

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.