Skip to content

Commit edc9bd4

Browse files
author
jan
committed
First successful test for #1126
1 parent 4ff3e36 commit edc9bd4

File tree

4 files changed

+42
-16
lines changed

4 files changed

+42
-16
lines changed

io.sloeber.core/plugin.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
id="io.sloeber.compiler.c.link.output"
180180
name="%outputType.C.link.name"
181181
namePattern="*.o"
182-
nameProvider="io.sloeber.managedBuild.Internal.CompileOutputNameProvider">
182+
nameProvider="io.sloeber.core.builder.CompileOutputNameProvider">
183183
</outputType>
184184
<outputType
185185
buildVariable="AR_OBJ"
@@ -220,7 +220,7 @@
220220
id="io.sloeber.compiler.S.sketch.link.output"
221221
name="%outputType.S.link.name"
222222
namePattern="%.o"
223-
nameProvider="io.sloeber.managedBuild.Internal.CompileOutputNameProvider"
223+
nameProvider="io.sloeber.core.builder.CompileOutputNameProvider"
224224
superClass="io.sloeber.compiler.c.link.output">
225225
</outputType>
226226
<outputType
@@ -240,6 +240,7 @@
240240
buildVariable="AR"
241241
id="io.sloeber.tool.archiver.output"
242242
name="%outputType.archiver.name"
243+
nameProvider="io.sloeber.core.builder.ArchiveOutputNameProvider"
243244
outputExtension="ar"
244245
outputName="${archive_file}">
245246
</outputType>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package io.sloeber.core.builder;
2+
3+
import org.eclipse.core.resources.IFile;
4+
import org.eclipse.core.runtime.IPath;
5+
6+
import io.sloeber.autoBuild.api.IAutoBuildConfigurationDescription;
7+
import io.sloeber.autoBuild.extensionPoint.IOutputNameProvider;
8+
import static io.sloeber.core.api.Const.*;
9+
import io.sloeber.core.api.ISloeberConfiguration;
10+
import io.sloeber.schema.api.IInputType;
11+
import io.sloeber.schema.api.IOutputType;
12+
13+
public class ArchiveOutputNameProvider implements IOutputNameProvider {
14+
15+
16+
@Override
17+
public String getOutputFileName(IFile inputFile, IAutoBuildConfigurationDescription autoData, IInputType inputType,
18+
IOutputType outputType) {
19+
20+
ISloeberConfiguration sloeberConf = ISloeberConfiguration.getConfig(autoData);
21+
if (sloeberConf == null) {
22+
// This should not happen
23+
return null;
24+
}
25+
IPath buildPath=autoData.getBuildFolder().getProjectRelativePath();
26+
IPath inputFilePath = inputFile.getProjectRelativePath();
27+
String inputFilePathSegments[]=inputFilePath.segments();
28+
for(int curSegment=buildPath.segmentCount() ;curSegment<inputFilePathSegments.length;curSegment++) {
29+
if(SLOEBER_LIBRARY_FOLDER_NAME.equals( inputFilePathSegments[curSegment])){
30+
return inputFilePathSegments[curSegment+1]+DOT+outputType.getOutputExtension();
31+
}
32+
}
33+
return outputType.getOutputName();
34+
}
35+
36+
}

io.sloeber.core/src/io/sloeber/managedBuild/Internal/CompileOutputNameProvider.java renamed to io.sloeber.core/src/io/sloeber/core/builder/CompileOutputNameProvider.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.sloeber.managedBuild.Internal;
1+
package io.sloeber.core.builder;
22

33
import java.util.HashMap;
44
import java.util.Map;
@@ -70,13 +70,13 @@ private static boolean isArchiverFile(IFile inputFile, ISloeberConfiguration slo
7070
KeyValueTree rootSection = libProps.getData();
7171
ret = Boolean.valueOf(rootSection.getValue(LIBRARY_DOT_A_LINKAGE)).booleanValue();
7272
}
73-
isArchiveLib.put(libName, ret);
73+
isArchiveLib.put(libName, Boolean.valueOf(ret));
7474
return ret;
7575

7676
}
7777
// It is standard sketch code. No archiver needed
7878

79-
return true;
79+
return false;
8080
}
8181

8282
}

io.sloeber.core/src/io/sloeber/managedBuild/api/INewManagedOutputNameProvider.java

-11
This file was deleted.

0 commit comments

Comments
 (0)