Question [q] how to port applications

how to port jellybean or ics apps to gingerbread roms...
im trying to make my own custom rom for my device galaxy ace gt-s5830i...??