Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include all files in the variants folder for compiling. #588

Open
ricklon opened this issue Aug 20, 2015 · 9 comments
Open

Include all files in the variants folder for compiling. #588

ricklon opened this issue Aug 20, 2015 · 9 comments
Assignees

Comments

@ricklon
Copy link
Member

ricklon commented Aug 20, 2015

Include all files in the variants folder for compiling. This the better way to do that.

  if (variantFolder != null)
      objectFiles.addAll(compileFiles(buildFolder, variantFolder, true,
                                      includeFolders));
@EmbeddedMan
Copy link
Member

Rick, where should this line go? At the very top of compileSketch() in Compiler.java?

@ricklon
Copy link
Member Author

ricklon commented Oct 21, 2015

I'll check. Will have feedback tonight.

--Rick

On Wed, Oct 21, 2015 at 10:11 AM, Brian Schmalz notifications@github.com
wrote:

Rick, where should this line go? At the very top of compileSketch() in
Compiler.java?


Reply to this email directly or view it on GitHub
#588 (comment)
.

Co-founder
Fair Use Building and Research (FUBAR) Labs
http://fubarlabs.org

@EmbeddedMan
Copy link
Member

Rick - I think this is the last major MPIDE 'bug' to squash before it will compile the blink sketch for all boards.

@ricklon
Copy link
Member Author

ricklon commented Oct 22, 2015

variant folder is found in this code

    if (variant != null) {
            if (variant.indexOf(':') == -1) {
                Target t = Base.getTarget();
                variantPath = t.getVariantFolder(variant).getAbsolutePath();
            } else {
                Target t = Base.targetsTable.get(variant.substring(0,
variant.indexOf(':')));
                variantPath = t.getVariantFolder(variant).getAbsolutePath();
            }
        }

        logger.debug("Variant Path: " + variantPath);

On Wed, Oct 21, 2015 at 8:16 PM, Brian Schmalz notifications@github.com
wrote:

Rick - I think this is the last major MPIDE 'bug' to squash before it will
compile the blink sketch for all boards.


Reply to this email directly or view it on GitHub
#588 (comment)
.

Co-founder
Fair Use Building and Research (FUBAR) Labs
http://fubarlabs.org

@ricklon
Copy link
Member Author

ricklon commented Oct 22, 2015

It's stuffed inside this variable: includePaths

compileSketch(avrBasePath, buildPath, includePaths, configPreferences);

On Wed, Oct 21, 2015 at 10:43 PM, Rick Anderson <rick.rickanderson@gmail.com

wrote:

variant folder is found in this code

    if (variant != null) {
            if (variant.indexOf(':') == -1) {
                Target t = Base.getTarget();
                variantPath =
t.getVariantFolder(variant).getAbsolutePath();
            } else {
                Target t = Base.targetsTable.get(variant.substring(0,
variant.indexOf(':')));
                variantPath =
t.getVariantFolder(variant).getAbsolutePath();
            }
        }

        logger.debug("Variant Path: " + variantPath);

On Wed, Oct 21, 2015 at 8:16 PM, Brian Schmalz notifications@github.com
wrote:

Rick - I think this is the last major MPIDE 'bug' to squash before it
will compile the blink sketch for all boards.


Reply to this email directly or view it on GitHub
#588 (comment)
.

Co-founder
Fair Use Building and Research (FUBAR) Labs
http://fubarlabs.org

Co-founder
Fair Use Building and Research (FUBAR) Labs
http://fubarlabs.org

@ricklon
Copy link
Member Author

ricklon commented Oct 22, 2015

Then these files are searched for and added .c, .cpp, .S compiled in.

this.objectFiles.addAll(compileFiles(avrBasePath, buildPath, includePaths,
findFilesInPath(buildPath, "S", false),
findFilesInPath(buildPath, "c", false),
findFilesInPath(buildPath, "cpp", false),
configPreferences));

But it looks for "buildPath" in this portion of code.

--RIck

On Wed, Oct 21, 2015 at 10:44 PM, Rick Anderson <rick.rickanderson@gmail.com

wrote:

It's stuffed inside this variable: includePaths

compileSketch(avrBasePath, buildPath, includePaths, configPreferences);

On Wed, Oct 21, 2015 at 10:43 PM, Rick Anderson <
rick.rickanderson@gmail.com> wrote:

variant folder is found in this code

    if (variant != null) {
            if (variant.indexOf(':') == -1) {
                Target t = Base.getTarget();
                variantPath =
t.getVariantFolder(variant).getAbsolutePath();
            } else {
                Target t = Base.targetsTable.get(variant.substring(0,
variant.indexOf(':')));
                variantPath =
t.getVariantFolder(variant).getAbsolutePath();
            }
        }

        logger.debug("Variant Path: " + variantPath);

On Wed, Oct 21, 2015 at 8:16 PM, Brian Schmalz notifications@github.com
wrote:

Rick - I think this is the last major MPIDE 'bug' to squash before it
will compile the blink sketch for all boards.


Reply to this email directly or view it on GitHub
#588 (comment)
.

Co-founder
Fair Use Building and Research (FUBAR) Labs
http://fubarlabs.org

Co-founder
Fair Use Building and Research (FUBAR) Labs
http://fubarlabs.org

Co-founder
Fair Use Building and Research (FUBAR) Labs
http://fubarlabs.org

@EmbeddedMan
Copy link
Member

Rick,

Right, but I don't see how to get all of the files in the variant folder to
compile. Your initial code snippit doesn't compile.

Brian
On Oct 21, 2015 9:45 PM, "Ricklon" notifications@github.com wrote:

It's stuffed inside this variable: includePaths

compileSketch(avrBasePath, buildPath, includePaths, configPreferences);

On Wed, Oct 21, 2015 at 10:43 PM, Rick Anderson <
rick.rickanderson@gmail.com

wrote:

variant folder is found in this code

if (variant != null) {
if (variant.indexOf(':') == -1) {
Target t = Base.getTarget();
variantPath =
t.getVariantFolder(variant).getAbsolutePath();
} else {
Target t = Base.targetsTable.get(variant.substring(0,
variant.indexOf(':')));
variantPath =
t.getVariantFolder(variant).getAbsolutePath();
}
}

logger.debug("Variant Path: " + variantPath);

On Wed, Oct 21, 2015 at 8:16 PM, Brian Schmalz <notifications@github.com

wrote:

Rick - I think this is the last major MPIDE 'bug' to squash before it
will compile the blink sketch for all boards.


Reply to this email directly or view it on GitHub
<
#588 (comment)

.

Co-founder
Fair Use Building and Research (FUBAR) Labs
http://fubarlabs.org

Co-founder
Fair Use Building and Research (FUBAR) Labs
http://fubarlabs.org


Reply to this email directly or view it on GitHub
#588 (comment)
.

@ricklon
Copy link
Member Author

ricklon commented Oct 22, 2015

So it finally drills down to:

private List<File> compileFiles(String avrBasePath,
String buildPath,
ArrayList<String> includePaths,
List<File> sSources, List<File>
cSources,
List<File> cppSources,
HashMap<String, String> configPreferences) throws RunnerException {

List<File> objectPaths = new ArrayList<File>();

for (File file : sSources) {
String objectPath = buildPath + File.separator + file.getName()
+ ".o";
objectPaths.add(new File(objectPath));
execAsynchronously(getCommandCompilerS(avrBasePath, includePaths,
file.getAbsolutePath(), objectPath, configPreferences));
}

for (File file : cSources) {
String objectPath = buildPath + File.separator + file.getName()
+ ".o";
objectPaths.add(new File(objectPath));
execAsynchronously(getCommandCompilerC(avrBasePath, includePaths,
file.getAbsolutePath(), objectPath, configPreferences));
}

for (File file : cppSources) {
String objectPath = buildPath + File.separator + file.getName()
+ ".o";
objectPaths.add(new File(objectPath));
execAsynchronously(getCommandCompilerCPP(avrBasePath, includePaths,
file.getAbsolutePath(), objectPath, configPreferences));
}

return objectPaths;
}

On Wed, Oct 21, 2015 at 10:50 PM, Brian Schmalz notifications@github.com
wrote:

Rick,

Right, but I don't see how to get all of the files in the variant folder to
compile. Your initial code snippit doesn't compile.

Brian
On Oct 21, 2015 9:45 PM, "Ricklon" notifications@github.com wrote:

It's stuffed inside this variable: includePaths

compileSketch(avrBasePath, buildPath, includePaths, configPreferences);

On Wed, Oct 21, 2015 at 10:43 PM, Rick Anderson <
rick.rickanderson@gmail.com

wrote:

variant folder is found in this code

if (variant != null) {
if (variant.indexOf(':') == -1) {
Target t = Base.getTarget();
variantPath =
t.getVariantFolder(variant).getAbsolutePath();
} else {
Target t = Base.targetsTable.get(variant.substring(0,
variant.indexOf(':')));
variantPath =
t.getVariantFolder(variant).getAbsolutePath();
}
}

logger.debug("Variant Path: " + variantPath);

On Wed, Oct 21, 2015 at 8:16 PM, Brian Schmalz <
notifications@github.com

wrote:

Rick - I think this is the last major MPIDE 'bug' to squash before it
will compile the blink sketch for all boards.


Reply to this email directly or view it on GitHub
<

#588 (comment)

.

Co-founder
Fair Use Building and Research (FUBAR) Labs
http://fubarlabs.org

Co-founder
Fair Use Building and Research (FUBAR) Labs
http://fubarlabs.org


Reply to this email directly or view it on GitHub
<
#588 (comment)

.


Reply to this email directly or view it on GitHub
#588 (comment)
.

Co-founder
Fair Use Building and Research (FUBAR) Labs
http://fubarlabs.org

@EmbeddedMan
Copy link
Member

I can confirm that this works as WiFire is now building without compile errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants