587
|
1 |
/*
|
|
2 |
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
package com.nokia.helium.sysdef.ant.taskdefs;
|
|
18 |
|
|
19 |
import java.io.File;
|
|
20 |
import java.util.Hashtable;
|
|
21 |
|
|
22 |
/**
|
|
23 |
* <p>This task allows to downgrade of a system definition file v3.0 into v2.0.</p>
|
|
24 |
*
|
|
25 |
* <p>The following example shows how you can downgrade the X:\model.sysdef.xml as
|
|
26 |
* X:\model_2_0_1.sysdef.xml.</p>
|
|
27 |
*
|
|
28 |
* E.g:
|
|
29 |
* <pre>
|
|
30 |
* <hlm:downgradeSysdef epocroot="X:\" srcfile="X:\model.sysdef.xml"
|
|
31 |
* destfile="X:\model_2_0_1.sysdef.xml" />
|
|
32 |
* </pre>
|
|
33 |
*
|
|
34 |
* For more information about system definition file v3.0 please check
|
|
35 |
* <a href="http://developer.symbian.org/wiki/index.php/System_Definition">http://developer.symbian.org/wiki/index.php/System_Definition</a>.
|
|
36 |
*
|
628
|
37 |
* <br>
|
|
38 |
* This task relies on externals tools. Their location can be configured the following ways:
|
|
39 |
* <li>by configuring the sysdef.tools.home property, fails if the location is incorrect.
|
|
40 |
* <li>The parent folder of the joinsysdef tool from the PATH, fallback on SDK location.
|
|
41 |
* <li>Default SDK location.
|
|
42 |
*
|
587
|
43 |
* @ant.task name="downgradeSysdef" category="Sysdef"
|
|
44 |
*/
|
|
45 |
public class DowngradeTask extends AbstractSydefTask {
|
628
|
46 |
private static final String XSLT = "sysdefdowngrade.xsl";
|
587
|
47 |
|
|
48 |
/**
|
|
49 |
* {@inheritDoc}
|
|
50 |
*/
|
|
51 |
public void execute() {
|
|
52 |
check();
|
|
53 |
log("Downgrading " + this.getSrcFile() + " to 2.0.1 schema.");
|
|
54 |
log("Creating " + this.getDestFile());
|
|
55 |
transform(new Hashtable<String, String>());
|
|
56 |
}
|
|
57 |
|
|
58 |
/**
|
|
59 |
* {@inheritDoc}
|
|
60 |
*/
|
|
61 |
@Override
|
|
62 |
protected File getXsl() {
|
628
|
63 |
return new File(SysdefUtils.getSysdefHome(getProject(), this.getEpocroot()), XSLT);
|
587
|
64 |
}
|
|
65 |
}
|