AssetBundles Unity5 (No AssetBundle has been set for this build)

Hi, i saw the changes in Unity5 assetbundles export methods. However i need to create assetbundles in a script and run that script from command line. In unity 4.6 it worked.

I was trying to create assetbundles with this example :

@MenuItem("Test/Build Asset Bundles")
static function BuildABs() {
	// Create the array of bundle build details.
	var buildMap: AssetBundleBuild[] = new AssetBundleBuild[1];
	
	buildMap[0].assetBundleName = "enemybundle";
	var enemyAssets: String[] = new String[1];
	enemyAssets[0] = "cube_prefab";
  	buildMap[0].assetNames = enemyAssets;
	

	
	BuildPipeline.BuildAssetBundles("Assets/ABs", buildMap);
}

It should create assetbundles using some building map. I created a simple cube , made a prefab from it and called it cube_prefab. When i run this script i just get a warning No AssetBundle has been set for this build.

I solved it, you need to put relative paths into the assetnames … so instead of “cube_prefab” it should be “Assets/cube_prefab.prefab” and it works.

is this script for build assetbundle at runtime?

I still can’t figure it out.