This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 168804 - Suite Customizer doesn't work for custom platforms
Summary: Suite Customizer doesn't work for custom platforms
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker with 1 vote (vote)
Assignee: rmichalsky
URL:
Keywords:
: 172014 173493 (view as bug list)
Depends on: 180475
Blocks:
  Show dependency tree
 
Reported: 2009-07-20 12:23 UTC by maxnitribitt
Modified: 2010-02-09 11:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description maxnitribitt 2009-07-20 12:23:34 UTC
A custom platform created with the create-platform ANT target doesn't work with the Suite Customizer. When you select a
cluster in libraries, close and reopen the properties panel, it will be deselected again.

Steps to reproduce:

Create a new NetBeans Platform Application "suite1". 
Go to important files, right-click build.xml, invoke ANT-target "create-platform".
Create a second NetBeans Platform Application "suite2".
Go to properties -> Libraries, manage platforms -> add platform.
Add the platform created with the create-platform ANT target and close.
Back in te suites properties choose the suite1 platform from the dropdown list.
Select platform10
Close and reopen the Suites properties:

Expected behaviour:
platform10 should be selected

Observed behaviour:
platform10 is deselected
When you create a module in your suite, you cannot set deopendencies on modules from platform10

As a result it's impossible to do any development when using a custom platform
Comment 1 maxnitribitt 2009-07-20 13:52:19 UTC
It's getting weird:

When you've reopened the SuiteCustomizerLibraries Panel as I described, so the cluster platform10 is deselected and
close by clicking OK, cluster.path in platform.properties is empty as expected. But the platform modules are then
available for dependency management in modules of the suite, while a clean and build fails with this:

/Users/antonepple/Desktop/ElsterPlatform/suite4/nbproject/build-impl.xml:34: Path to 'platform' cluster missing in
${cluster.path} property or using corrupt Netbeans Platform (missing harness).

So I can either have the settings correct for the build, or for the development...



Comment 2 rmichalsky 2009-07-20 14:04:12 UTC
Ok, couple of questions:
1) What version of IDE do you use?
2) What is the version of the base platform (the one suite1 is built against)?
3) What is the harness setting for both suites (base suite and your custom suite) in NB Platform Manager? I mean
"Harness bundled with IDE" vs. "Harness bundled with Platform" on Harness tab.
Comment 3 maxnitribitt 2009-07-20 14:17:57 UTC
1) What version of IDE do you use?
Standard 6.7: 
Product Version: NetBeans IDE 6.7 (Build 200906241340)
Java: 1.6.0_13; Java HotSpot(TM) 64-Bit Server VM 11.3-b02-83
System: Mac OS X version 10.5.7 running on x86_64; MacRoman; de_DE (nb)
Userdir: /Users/antonepple/.netbeans/6.7

This issue has originally been reported by me from someone else who has got the same problem using 6.7 on windows.
They've downloaded 6.7 last friday. I've reproduced it on my mac.

2) What is the version of the base platform (the one suite1 is built against)?
It's the IDE, so Product Version: NetBeans IDE 6.7 (Build 200906241340)  as well

3) What is the harness setting for both suites (base suite and your custom suite) in NB Platform Manager? I mean
"Harness bundled with IDE" vs. "Harness bundled with Platform" on Harness tab.

Harness supplied with IDE for both
Comment 4 maxnitribitt 2009-07-21 13:35:55 UTC
I found the root cause. It's the FileOwnerQuery in ClusterUtils evaluateClusterPath method which will return a project,
when the platform directory is located inside a project:

prj = FileOwnerQuery.getOwner(fo);

then the clusterPath ClusterInfo is created via ClusterInfo with a Project that is not null:

createFromCP(File evaluatedPath, Project prj,
            boolean isPlatformCluster, URL[] sourceRoots, URL[] javadocRoots, boolean enabled) 

The node ClusterInfo is created with:

create(File clusterDir, boolean isPlatformCluster, boolean enabled)

Later in SuiteCustomizerLibraries both are compared via their hash codes, which are different, because in one case the
project wasn't null:
 if (!clusterPath.contains(node.getClusterInfo())) // must not call setEnabled(true), disabled modules would be enabled
                {
                    node.setEnabled(false);
                }

When using the IDEs platform, the createFromCP is called with project being null. therefore it works.

Workaround:

After performing create_platform task move your platform outside of the dist directory and place it somewhere else (not
inside a project). 



 



Comment 5 rmichalsky 2009-07-21 13:38:08 UTC
Reproducible, I'll fix that. However if you use 6.7 harness, why bother with creating custom platform? Just use default
platform in suite2 and add suite1 in Properties -> Libraries -> Add Project... 

Target create-platform should probably be deprecated now (well, at least partially :)).
Comment 6 maxnitribitt 2009-07-21 13:50:42 UTC
You're right, with 6.7 there are nicer ways for adding a cluster or a project...
Thanks for taking care of this Richard!

-- Toni
Comment 7 rmichalsky 2009-07-21 13:52:28 UTC
> I found the root cause. 

Thanks! So you've really dived into apisupport sources, congratulations :).
Comment 8 maxnitribitt 2009-07-21 14:32:06 UTC
> Target create-platform should probably be deprecated now (well, at least partially :)).

Having a binary platform still has some advantages. I like to have a shared binary platform in cvs. It's great for
working in a team. Everyone has the same platform regardless what IDE he has. With adding clusters or projects that's
not possible.
Comment 9 rmichalsky 2009-07-21 15:03:16 UTC
> With adding clusters or projects that's not possible.

You can just put suite1 (i.e. the suite that you'd invoke create-platform on) at the location where you'd put your
binary platform. 

Pros: No need to have 2 separate repos, no need to update binary platform each time suite1 sources change.

Cons: You have to either manually build suite1 or create custom build.xml that builds your suites in correct order (and
when needed)

But I admit there may be some use cases. That's why I wrote "partially".

Fixed in core-main #702f7688d05d
Comment 10 Quality Engineering 2009-07-25 06:23:41 UTC
Integrated into 'main-golden', will be available in build *200907250201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/702f7688d05d
User: Richard Michalsky <rmichalsky@netbeans.org>
Log: #168804: fixing custom platform badly handled by suite customizer + note on cluster.path
Comment 11 rmichalsky 2009-09-14 15:19:24 UTC
*** Issue 172014 has been marked as a duplicate of this issue. ***
Comment 12 rmichalsky 2009-10-12 14:38:30 UTC
*** Issue 173493 has been marked as a duplicate of this issue. ***
Comment 13 Jesse Glick 2009-10-12 15:29:16 UTC
Duplicate was reproducible and marked P2.